FIX: FileHelper#download should return nil if max size is exceeded.

This commit is contained in:
Guo Xiang Tan
2018-08-17 16:17:58 +08:00
parent be89f593f9
commit a26ef7738f
2 changed files with 17 additions and 1 deletions

View File

@ -67,7 +67,11 @@ class FileHelper
tmp.write(chunk)
throw :done if tmp.size > max_file_size
if tmp.size > max_file_size
tmp.close
tmp = nil
throw :done
end
end
tmp&.rewind