From ba1285fdef5f8f790425896e26f1281b6f46f97d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 16 Oct 2016 12:13:59 -0400 Subject: [PATCH] Fix upgrade error if no related items --- chrome/content/zotero/xpcom/schema.js | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index b68d3770b1..01ad46a4c3 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -2291,6 +2291,7 @@ Zotero.Schema = new function(){ let userSegment = yield Zotero.DB.valueQueryAsync("SELECT IFNULL((SELECT value FROM settings WHERE setting='account' AND key='userID'), 'local/' || (SELECT value FROM settings WHERE setting='account' AND key='localUserKey'))"); let predicateID = yield Zotero.DB.valueQueryAsync("SELECT predicateID FROM relationPredicates WHERE predicate='dc:relation'"); + if (!predicateID) continue; let rows = yield Zotero.DB.queryAsync("SELECT ROWID AS id, * FROM itemRelations WHERE predicateID=?", predicateID); for (let i = 0; i < rows.length; i++) { let row = rows[i];