Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix nil deref issue with people hitting chests too often.
  • Loading branch information
sofar committed May 8, 2017
1 parent a533434 commit 55f81d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mods/default/nodes.lua
Expand Up @@ -1801,11 +1801,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "default:chest" then
return
end
if not fields.quit then
if not player or not fields.quit then
return
end
local pn = player:get_player_name()
if not open_chests[pn] then
return
end
local pos = open_chests[pn].pos
local sound = open_chests[pn].sound
local swap = open_chests[pn].swap
Expand Down

0 comments on commit 55f81d0

Please sign in to comment.