aboutsummaryrefslogtreecommitdiff
path: root/builtin/game/chatcommands.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/game/chatcommands.lua')
-rw-r--r--builtin/game/chatcommands.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index 3dfc29ffa..e788a2a54 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -653,8 +653,8 @@ core.register_chatcommand("pulverize", {
core.rollback_punch_callbacks = {}
core.register_on_punchnode(function(pos, node, puncher)
- local name = puncher:get_player_name()
- if core.rollback_punch_callbacks[name] then
+ local name = puncher and puncher:get_player_name()
+ if name and core.rollback_punch_callbacks[name] then
core.rollback_punch_callbacks[name](pos, node, puncher)
core.rollback_punch_callbacks[name] = nil
end