Fix upgrade error if no related items

This commit is contained in:
Dan Stillman 2016-10-16 12:13:59 -04:00
parent 40abd18895
commit ba1285fdef

View file

@ -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];