Skip to content

Commit

Permalink
fix: possible nil table on useStamina function (#1002)
Browse files Browse the repository at this point in the history
In some scenario where the player is no longer online, but the event is still running, it will give a nil value error when trying to access the table with the player ID, generating the "nil value" error.
  • Loading branch information
dudantas authored Apr 19, 2023
1 parent a0f4733 commit 8d511b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/events/scripts/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ local function useStamina(player)
end

local playerId = player:getId()
if not playerId then
if not playerId or not nextUseStaminaTime[playerId] then
return false
end

Expand Down

0 comments on commit 8d511b2

Please sign in to comment.