commit 985a5db0daf6fb7e3c30350c2bc11aebaf92b744
parent 755ead21194f57d11f00e80754d501ac0158bfb6
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 9 Sep 2014 02:10:04 -0400
Throw error if NULL libraryID is passed to DataObjects.getByLibraryAndKey()
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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;
}