Fixed crash when smartshop position unknown
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sat, 20 Jan 2018 13:49:30 +0000 (14:49 +0100)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sat, 20 Jan 2018 13:49:30 +0000 (14:49 +0100)
init.lua

index e4d297f..ce6cce0 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -79,6 +79,9 @@ smartshop.receive_fields=function(player,pressed)
                                if pressed["buy" .. i] then break end\r
                        end\r
                        local pos=smartshop.user[player:get_player_name()]\r
+                       if not pos then\r
+                          return\r
+                       end\r
                        local meta=minetest.get_meta(pos)\r
                        local type=meta:get_int("type")\r
                        local inv=meta:get_inventory()\r