Throw error if NULL libraryID is passed to DataObjects.getByLibraryAndKey()
This commit is contained in:
parent
755ead2119
commit
985a5db0da
|
@ -275,6 +275,9 @@ Zotero.DataObjects = function (object, objectPlural, id, table) {
|
||||||
|
|
||||||
|
|
||||||
this.getIDFromLibraryAndKey = function (libraryID, key) {
|
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])
|
return (this._objectIDs[libraryID] && this._objectIDs[libraryID][key])
|
||||||
? this._objectIDs[libraryID][key] : false;
|
? this._objectIDs[libraryID][key] : false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user