1
0
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:
Argyle 2019-03-14 20:13:16 -04:00 committed by lisacvuk
parent 5f87854323
commit ea5426316e

View File

@ -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"