fix obj nil bug
authorTenPlus1 <kinsellaja@yahoo.com>
Tue, 31 May 2016 16:31:19 +0000 (17:31 +0100)
committerTenPlus1 <kinsellaja@yahoo.com>
Tue, 31 May 2016 16:31:19 +0000 (17:31 +0100)
init.lua

index 679cebf..061b184 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -241,7 +241,9 @@ function minetest.is_protected(pos, digger)
 
                                        -- drop stack
                                        local obj = minetest.add_item(player:getpos(), sta)
-                                       obj:setvelocity({x = 0, y = 5, z = 0})
+                                       if obj then
+                                               obj:setvelocity({x = 0, y = 5, z = 0})
+                                       end
                                end)
 
                        end