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