1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-26 14:18:21 +00:00

Fix crash when accessing variables in filters that don't have a widget context

This should catch a large number of crashes, including:

Fixes #5716
This commit is contained in:
jeremy@jermolene.com 2021-05-22 20:00:24 +01:00
parent 3fc7895af2
commit 485779f5b2

View File

@ -323,6 +323,9 @@ exports.compileFilter = function(filterString) {
} else if(typeof source === "object") { // Array or hashmap
source = self.makeTiddlerIterator(source);
}
if(!widget) {
widget = $tw.rootWidget;
}
var results = new $tw.utils.LinkedList();
$tw.utils.each(operationFunctions,function(operationFunction) {
operationFunction(results,source,widget);