Commit 4b34c875 authored by Shinya Maeda's avatar Shinya Maeda

Add guardclause of offset < 0 in #truncate

parent 6ed91266
......@@ -134,7 +134,7 @@ module Gitlab
end
def truncate(offset)
raise ArgumentError, 'Outside of file' if offset > size
raise ArgumentError, 'Outside of file' if offset > size || offset < 0
return if offset == size # Skip the following process as it doesn't affect anything
@tell = offset
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment