1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Fix crash when sorting by non-string fields

tags, list, created, modified are not stored as strings by default.

Fixes #5701
This commit is contained in:
jeremy@jermolene.com 2021-05-19 14:10:39 +01:00
parent fe12a4adbf
commit dbd3f835bf

View File

@ -374,12 +374,12 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
var tiddlerA = self.getTiddler(a),
tiddlerB = self.getTiddler(b);
if(tiddlerA) {
a = tiddlerA.fields[sortField] || "";
a = tiddlerA.getFieldString(sortField) || "";
} else {
a = "";
}
if(tiddlerB) {
b = tiddlerB.fields[sortField] || "";
b = tiddlerB.getFieldString(sortField) || "";
} else {
b = "";
}