From d4569d3640a63c80d89f9d38ee08ddb59e663daf Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 7 Oct 2017 03:43:02 -0400 Subject: [PATCH] Remove unnecessary condition --- chrome/content/zotero/xpcom/dataDirectory.js | 42 ++++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/chrome/content/zotero/xpcom/dataDirectory.js b/chrome/content/zotero/xpcom/dataDirectory.js index ce4d556d5..618cd2c20 100644 --- a/chrome/content/zotero/xpcom/dataDirectory.js +++ b/chrome/content/zotero/xpcom/dataDirectory.js @@ -282,29 +282,27 @@ Zotero.DataDirectory = { throw { name: "NS_ERROR_FILE_NOT_FOUND" }; } } - if (nsIFile) { - try { - let dbFile = OS.Path.join(nsIFile.path, dbFilename); - let mtime = (yield OS.File.stat(dbFile)).lastModificationDate; - Zotero.debug(`Database found at ${dbFile}, last modified ${mtime}`); - // If custom location has a newer DB, use that - if (!useProfile || mtime > profileSubdirModTime) { - dataDir = nsIFile.path; - useFirefoxProfileCustom = true; - useProfile = false; - } + try { + let dbFile = OS.Path.join(nsIFile.path, dbFilename); + let mtime = (yield OS.File.stat(dbFile)).lastModificationDate; + Zotero.debug(`Database found at ${dbFile}, last modified ${mtime}`); + // If custom location has a newer DB, use that + if (!useProfile || mtime > profileSubdirModTime) { + dataDir = nsIFile.path; + useFirefoxProfileCustom = true; + useProfile = false; } - catch (e) { - Zotero.logError(e); - // If we have a DB in the Zotero profile and get an error trying to - // access the custom location in Firefox, use the Zotero profile, since - // there's at least some chance it's right. Otherwise, throw an error. - if (!useProfile) { - // The error message normally gets the path from the pref, but - // we got it from the prefs file, so include it here - e.dataDir = nsIFile.path; - throw e; - } + } + catch (e) { + Zotero.logError(e); + // If we have a DB in the Zotero profile and get an error trying to + // access the custom location in Firefox, use the Zotero profile, since + // there's at least some chance it's right. Otherwise, throw an error. + if (!useProfile) { + // The error message normally gets the path from the pref, but + // we got it from the prefs file, so include it here + e.dataDir = nsIFile.path; + throw e; } } }