From 3a710ad9ce030cc5d69fbd4fc549626ca9de330d Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 23 Oct 2012 16:28:38 +0100 Subject: [PATCH] Fix problem with sortTiddlers --- core/modules/wiki.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 7d471235c..679ee34b8 100644 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -256,8 +256,12 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive) { b = self.getTiddler(b).fields[sortField] || ""; } if(!isCaseSensitive) { - a = a.toLowerCase(); - b = b.toLowerCase(); + if(typeof a === "string") { + a = a.toLowerCase(); + } + if(typeof b === "string") { + b = b.toLowerCase(); + } } if(a < b) { return isDescending ? +1 : -1;