Fix last filter operator when zero items selected (#7809)

Previously, [last[0]] was incorrectly returning the entire list. It now
returns zero items as it should.
This commit is contained in:
Robin Munn
2023-10-25 13:14:49 +01:00
committed by GitHub
parent 4ebaba8e89
commit 246751be1b
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -58,6 +58,7 @@ Last entry/entries in list
exports.last = function(source,operator,options) {
var count = $tw.utils.getInt(operator.operand,1),
results = [];
if(count === 0) return results;
source(function(tiddler,title) {
results.push(title);
});