mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-17 14:55:13 -05:00
Add sanity check to sort function
This commit is contained in:
parent
7935044820
commit
8489980039
@ -240,6 +240,12 @@ end
|
||||
function sort_worlds_alphabetic(this)
|
||||
|
||||
table.sort(this.m_processed_list, function(a, b)
|
||||
--fixes issue #857 (crash due to sorting nil in worldlist)
|
||||
if a == nil or b == nil then
|
||||
if a == nil and b ~= nil then return false end
|
||||
if b == nil and a ~= nil then return true end
|
||||
return false
|
||||
end
|
||||
if a.name:lower() == b.name:lower() then
|
||||
return a.name < b.name
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user