Correctly handle errors in util methods

This commit is contained in:
EvilFactory
2023-05-06 13:38:52 -03:00
parent 8e6f8cc5e6
commit bf988aa9ef
3 changed files with 29 additions and 0 deletions
@@ -24,6 +24,10 @@ for _, item in pairs(Item.ItemList) do
end
Util.GetItemsById = function(id)
if id == nil then
error(string.format("bad argument #1 to 'GetItemsById' (string expected, got %s)", type(id)), 2)
end
return itemDictionary[id]
end