From f0b7a212e5670804c9b879d44ec34a4d19a91170 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 20 Nov 2017 11:38:15 -0500 Subject: [PATCH] Skip migration on error checking whether dataDir is on different drive --- chrome/content/zotero/xpcom/dataDirectory.js | 23 +++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/xpcom/dataDirectory.js b/chrome/content/zotero/xpcom/dataDirectory.js index 6bbfde146..c060e28d9 100644 --- a/chrome/content/zotero/xpcom/dataDirectory.js +++ b/chrome/content/zotero/xpcom/dataDirectory.js @@ -840,14 +840,21 @@ Zotero.DataDirectory = { } // Skip migration if new dir on different drive and prompt - if (yield this.isNewDirOnDifferentDrive(dataDir, newDir)) { - Zotero.debug(`New dataDir ${newDir} is on a different drive from ${dataDir} -- skipping migration`); - Zotero.DataDirectory.newDirOnDifferentDrive = true; - - let error = Zotero.getString(`dataDir.migration.failure.full.automatic.newDirOnDifferentDrive`, Zotero.clientName) - + "\n\n" - + Zotero.getString(`dataDir.migration.failure.full.automatic.text2`, Zotero.appName); - return this.fullMigrationFailurePrompt(dataDir, newDir, error); + try { + if (yield this.isNewDirOnDifferentDrive(dataDir, newDir)) { + Zotero.debug(`New dataDir ${newDir} is on a different drive from ${dataDir} -- skipping migration`); + Zotero.DataDirectory.newDirOnDifferentDrive = true; + + let error = Zotero.getString(`dataDir.migration.failure.full.automatic.newDirOnDifferentDrive`, Zotero.clientName) + + "\n\n" + + Zotero.getString(`dataDir.migration.failure.full.automatic.text2`, Zotero.appName); + return this.fullMigrationFailurePrompt(dataDir, newDir, error); + } + } + catch (e) { + Zotero.logError("Error checking whether data directory is on different drive " + + "-- skipping migration:\n\n" + e); + return false; } // Check for an existing pipe from other running versions of Zotero pointing at the same data