diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 07f7a8418c..f5b4385b3a 100644 --- 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; },