From c33cc7d0c97898dfdf9cf5553cc1b470f01c3ad9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 9 Jan 2007 05:49:31 +0000 Subject: [PATCH] Not sure how this bug made it this far, but don't return empty values in Items.get() when passed an array including nonexistent itemIDs --- chrome/content/zotero/xpcom/data_access.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data_access.js b/chrome/content/zotero/xpcom/data_access.js index 9ddd16745..e7d1adf5c 100644 --- a/chrome/content/zotero/xpcom/data_access.js +++ b/chrome/content/zotero/xpcom/data_access.js @@ -2224,13 +2224,18 @@ Zotero.Items = new function(){ // If single id, return the object directly if (arguments[0] && typeof arguments[0]!='object' && typeof arguments[1]=='undefined'){ + if (!_items[arguments[0]]) { + Zotero.debug("Item " + arguments[0] + " doesn't exist", 2); + return false; + } return _items[arguments[0]]; } // Otherwise, build return array for (i=0; i