From 4e1937680f759f5aacb1ab6db43a3f930d6856ec Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 23 May 2017 02:04:58 -0400 Subject: [PATCH] Throw error if non-number is passed to Zotero.DataObjects.getAsync() Previously, if an id was psased as a string and the id existed in the cache, an error wouldn't be thrown, but if there id wasn't in the cache (e.g., because it was in an unloaded library) it would. This requires an integer in all cases. Note that, among other things, any code that gets ids from object keys will need to convert them to integers before passing to getAsync(). --- chrome/content/zotero/xpcom/data/dataObjects.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js index ba444d3a1..68b90f4a7 100644 --- a/chrome/content/zotero/xpcom/data/dataObjects.js +++ b/chrome/content/zotero/xpcom/data/dataObjects.js @@ -172,14 +172,16 @@ Zotero.DataObjects.prototype.getAsync = Zotero.Promise.coroutine(function* (ids, for (let i=0; i