mirror of
https://github.com/lisacvuk/minetest-toolranks.git
synced 2024-08-19 04:44:03 +02: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)
|
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"
|
return "pickaxe"
|
||||||
elseif string.find(description, "Axe") then
|
elseif string.find(description, "Axe") then
|
||||||
return "axe"
|
return "axe"
|
||||||
|
Loading…
Reference in New Issue
Block a user