From eefeb09d8a6750048c7a6c8ddd393439f4e9ad9e Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 25 Aug 2022 03:37:01 +0200 Subject: [PATCH] fixed crash --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 133ae2a..437ae97 100644 --- a/init.lua +++ b/init.lua @@ -95,11 +95,14 @@ end chesttools.may_use = function( pos, player ) - if( not( player )) then + if( not( player ) or not(pos) or not(pos.x)) then return false; end local name = player:get_player_name(); local meta = minetest.get_meta( pos ); + if(not(meta)) then + return false + end local owner = meta:get_string( 'owner' ) -- the owner can access the chest if( owner == name or owner == "" ) then