From a9728dfa798a223e4ee5c24ff817e653f3ce35bb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 21 Aug 2008 16:25:17 +0000 Subject: [PATCH] Fix "second argument to Function.prototype.apply must be an array" error in schema.js line 1636 on upgrade --- chrome/content/zotero/xpcom/schema.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index bdc5bdf02..e85e128a3 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -1633,7 +1633,7 @@ Zotero.Schema = new function(){ // Migrate big integers var itemIDs = Zotero.DB.columnQuery("SELECT itemID FROM items WHERE itemID>16777215"); var smalls = Zotero.DB.columnQuery("SELECT itemID FROM items WHERE itemID<300000"); - var newID = Math.max.apply(this, smalls); + var newID = smalls ? Math.max.apply(this, smalls) : 0; for each(var oldID in itemIDs) { do { newID = newID + 1;