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
new-json-store-area
jeremy@jermolene.com 2021-05-22 20:00:24 +01:00
rodzic 3fc7895af2
commit 485779f5b2
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -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);