mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-22 08:24:06 +00:00
varlist operator: fixed crash accessing non-existent variable
See https://github.com/TiddlyWiki/TiddlyWiki5/pull/8972#issuecomment-2712068743
This commit is contained in:
parent
d69ecf4639
commit
a31df85894
@ -5,8 +5,6 @@ module-type: filteroperator
|
|||||||
|
|
||||||
Retrieve the value of a variable as a list
|
Retrieve the value of a variable as a list
|
||||||
|
|
||||||
[all[shadows+tiddlers]]
|
|
||||||
|
|
||||||
\*/
|
\*/
|
||||||
(function(){
|
(function(){
|
||||||
|
|
||||||
@ -18,9 +16,8 @@ Retrieve the value of a variable as a list
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.varlist = function(source,operator,options) {
|
exports.varlist = function(source,operator,options) {
|
||||||
// Check for common optimisations
|
|
||||||
var variableInfo = operator.operand && options.widget.getVariableInfo(operator.operand);
|
var variableInfo = operator.operand && options.widget.getVariableInfo(operator.operand);
|
||||||
if(variableInfo) {
|
if(variableInfo && variableInfo.text !== undefined) {
|
||||||
return options.wiki.makeTiddlerIterator(variableInfo.resultList);
|
return options.wiki.makeTiddlerIterator(variableInfo.resultList);
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user