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:
+10
-6
@@ -95,12 +95,16 @@ def compare_alphanumerically(a : String, b : String)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def validate_archive(path : String) : Exception?
|
def validate_archive(path : String) : Exception?
|
||||||
file = ArchiveFile.new path
|
file = nil
|
||||||
file.check
|
begin
|
||||||
file.close
|
file = ArchiveFile.new path
|
||||||
return
|
file.check
|
||||||
rescue e
|
file.close
|
||||||
e
|
return
|
||||||
|
rescue e
|
||||||
|
file.close unless file.nil?
|
||||||
|
e
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def random_str
|
def random_str
|
||||||
|
|||||||
Reference in New Issue
Block a user