From ed2c7c90de207dcef63e50b651706ad071a8cf4a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 6 Jan 2025 11:38:12 +0000 Subject: [PATCH] Be more defensive about missing parameters --- core/modules/filter-tracker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/filter-tracker.js b/core/modules/filter-tracker.js index 424b85174..695126835 100644 --- a/core/modules/filter-tracker.js +++ b/core/modules/filter-tracker.js @@ -68,12 +68,12 @@ FilterTracker.prototype.processTracker = function(index) { results = this.wiki.filterTiddlers(tracker.filterString); // Process the results $tw.utils.each(results,function(title) { - if(tracker.previousResults.indexOf(title) === -1 && !tracker.resultValues[title]) { + if(tracker.previousResults.indexOf(title) === -1 && !tracker.resultValues[title] && tracker.fnEnter) { tracker.resultValues[title] = tracker.fnEnter(title) || true; } }); $tw.utils.each(tracker.previousResults,function(title) { - if(results.indexOf(title) === -1 && tracker.resultValues[title]) { + if(results.indexOf(title) === -1 && tracker.resultValues[title] && tracker.fnLeave) { tracker.fnLeave(title,tracker.resultValues[title]); delete tracker.resultValues[title]; } @@ -86,7 +86,7 @@ FilterTracker.prototype.processChanges = function(changes) { for(var t=0; t