Fix upgrade error in c96363746b if no related items

This commit is contained in:
Dan Stillman 2018-03-26 04:48:32 -04:00
parent c96363746b
commit 32aebd388b

View file

@ -2416,8 +2416,8 @@ Zotero.Schema = new function(){
else if (i == 100) {
let userID = yield Zotero.DB.valueQueryAsync("SELECT value FROM settings WHERE setting='account' AND key='userID'");
if (userID) {
let predicateID = yield Zotero.DB.valueQueryAsync("SELECT predicateID FROM relationPredicates WHERE predicate='dc:relation'");
let predicateID = yield Zotero.DB.valueQueryAsync("SELECT predicateID FROM relationPredicates WHERE predicate='dc:relation'");
if (userID && predicateID) {
let rows = yield Zotero.DB.queryAsync("SELECT itemID, object FROM items JOIN itemRelations IR USING (itemID) WHERE libraryID=? AND predicateID=?", [1, predicateID]);
for (let row of rows) {
let matches = row.object.match(/^http:\/\/zotero.org\/users\/(\d+)\/items\/([A-Z0-9]+)$/);