Skip to content

make Player::GameObject not nullable#418

Open
michcio15 wants to merge 1 commit into
northwood-studios:masterfrom
michcio15:why-is-this-nullable
Open

make Player::GameObject not nullable#418
michcio15 wants to merge 1 commit into
northwood-studios:masterfrom
michcio15:why-is-this-nullable

Conversation

@michcio15

Copy link
Copy Markdown
Contributor

it should not be nullable in the first place just why it is. if GameObject should be nullable then ReferenceHub should be nullable and if the ReferenceHub is null then the whole Player is null i am losing my ming

@Axwabo

Axwabo commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The GameObject becomes null when the player object is destroyed. Consequently, the ReferenceHub might also be null, though this isn't annotated currently. The GameObject nullability change was intentional

@michcio15

Copy link
Copy Markdown
Contributor Author

But it

The GameObject becomes null when the player object is destroyed. Consequently, the ReferenceHub might also be null, though this isn't annotated currently. The GameObject nullability change was intentional

But it does not make sens the GameObject is directly tied to the ReferenceHub which is directly tied to the whole Player wrapper so following this logic everything should be nullable

@michcio15

michcio15 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

So smth like Player::Rotation also should be nullable because it uses the GameObject and everything that uses ReferenceHub because if

ReferenceHub.gameObject is null => GameObject is null ^ ReferenceHub.gameObject is null => ReferenceHub is null

And also if there is a reason the player could be null developers should make the check because why should there be a null check when i know that a player has picked up a item?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants