Throw error if NULL libraryID is passed to DataObjects.getByLibraryAndKey()
This commit is contained in:
parent
755ead2119
commit
985a5db0da
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue