mirror of
https://github.com/lisacvuk/minetest-toolranks.git
synced 2024-11-14 14:00:21 +01:00
Crash fix - check if description is nil before trying to search it. (#3)
This commit is contained in:
parent
5f87854323
commit
ea5426316e
4
init.lua
4
init.lua
|
@ -10,7 +10,9 @@ toolranks.colors = {
|
|||
}
|
||||
|
||||
function toolranks.get_tool_type(description)
|
||||
if string.find(description, "Pickaxe") then
|
||||
if not description then
|
||||
return "tool"
|
||||
elseif string.find(description, "Pickaxe") then
|
||||
return "pickaxe"
|
||||
elseif string.find(description, "Axe") then
|
||||
return "axe"
|
||||
|
|
Loading…
Reference in New Issue
Block a user