projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7935044
)
Add sanity check to sort function
author
sapier
<Sapier at GMX dot net>
Sat, 24 Aug 2013 22:43:20 +0000
(
00:43
+0200)
committer
Kahrl
<kahrl@gmx.net>
Wed, 4 Sep 2013 23:45:39 +0000
(
01:45
+0200)
builtin/filterlist.lua
patch
|
blob
|
history
diff --git
a/builtin/filterlist.lua
b/builtin/filterlist.lua
index fd337ae92161d61fc4a3252c8e2445bfb8993d85..1c2ceb0316eeccb6dd4928cc815f2e2efd210333 100644
(file)
--- a/
builtin/filterlist.lua
+++ b/
builtin/filterlist.lua
@@
-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