commit 58f554a930b547de63c14dc87ca1bc1b4e87d767 parent 8a4c8d2be050575002a5bc74d37b43a921aa44fa Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 14 Dec 2016 02:02:35 -0500 Throw if invalid object id passed to Zotero.DataObjects::getAsync() Diffstat:
| M | chrome/content/zotero/xpcom/data/dataObjects.js | | | 3 | +++ |
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 @@ -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); } }