Skip to content
Snippets Groups Projects
Commit e9f6e606 authored by Rui's avatar Rui Committed by Auke Kok
Browse files

Fix mailbox error (#52)

`tiles` is not a required field. Indexing it may fail.

Fix #51
parent de2deee8
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,12 @@ local function img_col(stack)
if def.inventory_image ~= "" then
return def.inventory_image:match("(.*)%.png")..".png"
end
return def.tiles[1]:match("(.*)%.png")..".png"
if def.tiles and def.tiles[1] then
return def.tiles[1]:match("(.*)%.png")..".png"
end
return ""
end
function mailbox:formspec(pos, owner, num)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment