1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Fix removesuffix filter when title is undefined (#3827)

This commit is contained in:
Simon Huber 2019-03-11 10:37:49 +01:00 committed by Jeremy Ruston
parent 26c6d6035e
commit 784db30614

View File

@ -18,7 +18,7 @@ Export our filter function
exports.removesuffix = function(source,operator,options) { exports.removesuffix = function(source,operator,options) {
var results = []; var results = [];
source(function(tiddler,title) { source(function(tiddler,title) {
if(title.substr(-operator.operand.length) === operator.operand) { if(title && title.substr(-operator.operand.length) === operator.operand) {
results.push(title.substr(0,title.length - operator.operand.length)); results.push(title.substr(0,title.length - operator.operand.length));
} }
}); });