Fix mailbox error (#52)
`tiles` is not a required field. Indexing it may fail. Fix #51
This commit is contained in:
parent
de2deee86f
commit
e9f6e606e2
@ -8,7 +8,12 @@ local function img_col(stack)
|
|||||||
if def.inventory_image ~= "" then
|
if def.inventory_image ~= "" then
|
||||||
return def.inventory_image:match("(.*)%.png")..".png"
|
return def.inventory_image:match("(.*)%.png")..".png"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
function mailbox:formspec(pos, owner, num)
|
function mailbox:formspec(pos, owner, num)
|
||||||
|
Loading…
Reference in New Issue
Block a user