Throw actual error if file open fails in md5Async()

This commit is contained in:
Dan Stillman 2018-02-21 10:21:10 -05:00
parent 164fea0cec
commit 9cb2b8167d

View File

@ -190,11 +190,13 @@ Zotero.Utilities.Internal = {
var path = (file instanceof Components.interfaces.nsIFile) ? file.path : file; var path = (file instanceof Components.interfaces.nsIFile) ? file.path : file;
var hash; var hash;
try { try {
file = await OS.File.open(path); var osFile = await OS.File.open(path);
hash = await readChunk(file); hash = await readChunk(osFile);
} }
finally { finally {
await file.close(); if (osFile) {
await osFile.close();
}
} }
return hash; return hash;
}, },