Add guardclause of offset < 0 in #truncate
This commit is contained in:
parent
6ed91266d0
commit
4b34c875f7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue