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
1 changed files with 3 additions and 1 deletions

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"