Skip to content

Comments

Make Player.GameObject nullable and null check ReferenceHub before accessing it.#144

Merged
Jesus-QC merged 2 commits intonorthwood-studios:devfrom
xCynDev:player-gameobject-check
Sep 9, 2025
Merged

Make Player.GameObject nullable and null check ReferenceHub before accessing it.#144
Jesus-QC merged 2 commits intonorthwood-studios:devfrom
xCynDev:player-gameobject-check

Conversation

@xCynDev
Copy link
Contributor

@xCynDev xCynDev commented May 22, 2025

Considering ReferenceHub can be null/destroyed, this would avoid exceptions just from accessing Player.GameObject while it's not valid.

@Jesus-QC
Copy link
Contributor

This shouldn't be needed as players are subscribed to ReferenceHub.OnPlayerRemoved.

@xCynDev
Copy link
Contributor Author

xCynDev commented Jun 26, 2025

This shouldn't be needed as players are subscribed to ReferenceHub.OnPlayerRemoved.

This doesn't prevent invalid players when using coroutines.

@Jesus-QC Jesus-QC merged commit 8541cab into northwood-studios:dev Sep 9, 2025
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