commit ba1285fdef5f8f790425896e26f1281b6f46f97d
parent 40abd18895bf33fae498a37118bc3ab443379886
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 16 Oct 2016 12:13:59 -0400
Fix upgrade error if no related items
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git 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];