Skip to content

Commit 8489980

Browse files
sapierkahrl
sapier
authored andcommittedSep 4, 2013
Add sanity check to sort function
1 parent 7935044 commit 8489980

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎builtin/filterlist.lua

+6
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ end
240240
function sort_worlds_alphabetic(this)
241241

242242
table.sort(this.m_processed_list, function(a, b)
243+
--fixes issue #857 (crash due to sorting nil in worldlist)
244+
if a == nil or b == nil then
245+
if a == nil and b ~= nil then return false end
246+
if b == nil and a ~= nil then return true end
247+
return false
248+
end
243249
if a.name:lower() == b.name:lower() then
244250
return a.name < b.name
245251
end

0 commit comments

Comments
 (0)
Please sign in to comment.