From c61892e4b6f811ad4af79f607fe10c8b446caaee Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 23 Jun 2024 05:08:22 -0400 Subject: [PATCH] Fix Collections.getCollectionsContainingItems() when no ids are passed Previously it would return all collections --- chrome/content/zotero/xpcom/data/collections.js | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/content/zotero/xpcom/data/collections.js b/chrome/content/zotero/xpcom/data/collections.js index 6ca0d2f375..658b52b601 100644 --- a/chrome/content/zotero/xpcom/data/collections.js +++ b/chrome/content/zotero/xpcom/data/collections.js @@ -142,6 +142,7 @@ Zotero.Collections = function() { this.getCollectionsContainingItems = function (itemIDs, asIDs) { + if (!itemIDs.length) return []; var sql = "SELECT collectionID FROM collections WHERE "; var sqlParams = []; for (let id of itemIDs) {