From 985a5db0daf6fb7e3c30350c2bc11aebaf92b744 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 9 Sep 2014 02:10:04 -0400 Subject: [PATCH] Throw error if NULL libraryID is passed to DataObjects.getByLibraryAndKey() --- chrome/content/zotero/xpcom/data/dataObjects.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js index 9167b84215..b701142a10 100644 --- a/chrome/content/zotero/xpcom/data/dataObjects.js +++ b/chrome/content/zotero/xpcom/data/dataObjects.js @@ -275,6 +275,9 @@ Zotero.DataObjects = function (object, objectPlural, id, table) { this.getIDFromLibraryAndKey = function (libraryID, key) { + if (libraryID === null) { + throw new Error("libraryID cannot be NULL (did you mean 0?)"); + } return (this._objectIDs[libraryID] && this._objectIDs[libraryID][key]) ? this._objectIDs[libraryID][key] : false; }