Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: possible nil table on useStamina function #1002

Merged
merged 3 commits into from
Apr 19, 2023

Conversation

dudantas
Copy link
Member

Description

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.

Behaviour

Actual

An error occurs when trying to access the table with the player online.

Expected

No error happens.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested

It's something that doesn't happen very often, it just happens to happen that the player is no longer online but the stamina event is still running.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dudantas dudantas merged commit 5337250 into main Apr 19, 2023
@dudantas dudantas deleted the nil-table-use-stamina-function branch April 19, 2023 19:42
libergod referenced this pull request in libergod/canary_baiak Apr 24, 2023
luan pushed a commit that referenced this pull request Jul 11, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants