Skip to content

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

Merged
Jesus-QC merged 2 commits into
northwood-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 into
northwood-studios:devfrom
xCynDev:player-gameobject-check

Conversation

@xCynDev

@xCynDev xCynDev commented May 22, 2025

Copy link
Copy Markdown
Contributor

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

@Jesus-QC

Copy link
Copy Markdown
Contributor

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

@xCynDev

xCynDev commented Jun 26, 2025

Copy link
Copy Markdown
Contributor Author

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