From ea513edf732979d7ec1da089a488bce54de4e6a0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 13 Jul 2017 18:07:58 -0400 Subject: [PATCH] Prevent infinite loop if search points to itself --- chrome/content/zotero/xpcom/data/search.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/search.js b/chrome/content/zotero/xpcom/data/search.js index faf4dc7b9d..c081957164 100644 --- a/chrome/content/zotero/xpcom/data/search.js +++ b/chrome/content/zotero/xpcom/data/search.js @@ -1203,6 +1203,10 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () { id: 0 }; } + if (objectType == 'search' && obj == this) { + Zotero.warn(`Search "${this.name}" references itself -- skipping condition`); + continue; + } if (objectType == 'collection') { let ids = [obj.id];