From a31df85894236c2f4de193848213b23f6b1d19c7 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 11 Mar 2025 13:59:19 +0000 Subject: [PATCH] varlist operator: fixed crash accessing non-existent variable See https://github.com/TiddlyWiki/TiddlyWiki5/pull/8972#issuecomment-2712068743 --- core/modules/filters/varlist.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/modules/filters/varlist.js b/core/modules/filters/varlist.js index 5c6db3616..0857da2fe 100644 --- a/core/modules/filters/varlist.js +++ b/core/modules/filters/varlist.js @@ -5,8 +5,6 @@ module-type: filteroperator Retrieve the value of a variable as a list -[all[shadows+tiddlers]] - \*/ (function(){ @@ -18,9 +16,8 @@ Retrieve the value of a variable as a list Export our filter function */ exports.varlist = function(source,operator,options) { - // Check for common optimisations var variableInfo = operator.operand && options.widget.getVariableInfo(operator.operand); - if(variableInfo) { + if(variableInfo && variableInfo.text !== undefined) { return options.wiki.makeTiddlerIterator(variableInfo.resultList); } else { return [];