Fix removesuffix filter when title is undefined (#3827)

This commit is contained in:
Simon Huber
2019-03-11 09:37:49 +00:00
committed by Jeremy Ruston
parent 26c6d6035e
commit 784db30614
+1 -1
View File
@@ -18,7 +18,7 @@ Export our filter function
exports.removesuffix = function(source,operator,options) {
var results = [];
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));
}
});