mirror of
https://github.com/hkalexling/Mango.git
synced 2026-05-01 00:00:55 -04:00
Properly close archive files after validating them
This commit is contained in:
@@ -95,13 +95,17 @@ def compare_alphanumerically(a : String, b : String)
|
||||
end
|
||||
|
||||
def validate_archive(path : String) : Exception?
|
||||
file = nil
|
||||
begin
|
||||
file = ArchiveFile.new path
|
||||
file.check
|
||||
file.close
|
||||
return
|
||||
rescue e
|
||||
file.close unless file.nil?
|
||||
e
|
||||
end
|
||||
end
|
||||
|
||||
def random_str
|
||||
UUID.random.to_s.gsub "-", ""
|
||||
|
||||
Reference in New Issue
Block a user