LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

make Player::GameObject not nullable

Open michcio15 opened this issue 5 months ago • 3 comments

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

michcio15 avatar Jun 06 '26 23:06 michcio15

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

Axwabo avatar Jun 07 '26 04:06 Axwabo

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 avatar Jun 07 '26 18:06 michcio15

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?

michcio15 avatar Jun 07 '26 18:06 michcio15