www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 9cb2b8167dce47fb9749a8e92e55b6892e2a5dd6
parent 164fea0cec0f682b833fd59390a8b39d524362c5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 21 Feb 2018 10:21:10 -0500

Throw actual error if file open fails in md5Async()

Diffstat:
Mchrome/content/zotero/xpcom/utilities_internal.js | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js @@ -190,11 +190,13 @@ Zotero.Utilities.Internal = { var path = (file instanceof Components.interfaces.nsIFile) ? file.path : file; var hash; try { - file = await OS.File.open(path); - hash = await readChunk(file); + var osFile = await OS.File.open(path); + hash = await readChunk(osFile); } finally { - await file.close(); + if (osFile) { + await osFile.close(); + } } return hash; },