Except - and this is called out in the github thread - the reference is not null and does exist. The check is working correctly.
The problem lies in the fact that what you want to check for is "is the object I originally pointed to still around?", but instead of doing that, you're checking "is the thing I'm pointing to currently a valid object?".
I'm making a complex Godot game.
'is_instance_valid' does what you are describing.
https://github.com/godotengine/godot-proposals/issues/1589 https://github.com/godotengine/godot/issues/41179
Reduz doesn't want the fix in release builds because the will be slower!
On Oct 2 @RandomShaper said "is_instance_valid() was made thread-safe, but it's still not something you can trust. An object allocated at the same address as a freed one will report a false positive. That's, of course, considering that what you want to check is that your variable is still pointing to the object you assigned, and not to just some object, which I think is the case.
@reduz respoinded with "Ah that may be still the case of 3.2, but in 4.0 this function is 100% trustworthy"
There probably is such a method, but you'd have to invoke it on the object, not on some other unrelated object.
I can guarantee this is not an issue in Unity where a object that has been removed from the scene is null.