check player and hitter for nil values

master
Juraj Vajda 2018-01-10 09:34:36 -05:00
parent 5722bc45a0
commit 39766db303
1 changed files with 4 additions and 1 deletions

View File

@ -129,8 +129,11 @@ city_block.attack = {}
city_block.suspects = {}
function city_block.register_on_punchplayer(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
if not player or not hitter then
return
end
if not player:is_player() or not hitter:is_player() then
return;
return
end
local pname = player:get_player_name();
local name = hitter:get_player_name();