Throw if invalid object id passed to Zotero.DataObjects::getAsync()
This commit is contained in:
parent
8a4c8d2be0
commit
58f554a930
1 changed files with 3 additions and 0 deletions
|
@ -177,6 +177,9 @@ Zotero.DataObjects.prototype.getAsync = Zotero.Promise.coroutine(function* (ids,
|
|||
toReturn.push(this._objectCache[id]);
|
||||
}
|
||||
else {
|
||||
if (!ids.every(id => Number.isInteger(id))) {
|
||||
throw new Error(`Invalid ${this._ZDO_object} ID '${id}'`);
|
||||
}
|
||||
toLoad.push(id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue