godot
godot copied to clipboard
GDScript debugger may get null object issue
Godot version
4.0 stable
System information
Windows11
Issue description
null check always false
Steps to reproduce
Minimal reproduction project
no need
But the children of a node are never null?
Are you certain this node is null? There are some cases when the debugger shows data as null when they are too large
But the children of a node are never null?
Do you mean it is just a debug issue?
I'm not sure but it looks very strange that a child of a node is null, that should never happen as far as I know
I agree with you. I store this child to a list for later use. And I got a null value. So I foud this issue.
Is the node still valid at that time? Has it got deleted?
Real value isn't null.

#74148 might solve this
Is the node still valid at that time? Has it got deleted?
Many child nodes in my list are null. But not 100% make it clear.
Oh, sorry I was confused, can you confirm that the nodes are null, and how do you do so?
Are you sure it's null and not Freed Object?
var node := Node.new()
print(node) # <Node#3501556037163>
print(node == null) # false
print(node != null) # true
print("+" if node else "-") # +
print("+" if not node else "-") # -
node.free()
print(node) # <Freed Object>
print(node == null) # true
print(node != null) # false
print("+" if node else "-") # +
print("+" if not node else "-") # +
node = null
print(node) # <null>
print(node == null) # true
print(node != null) # false
print("+" if node else "-") # -
print("+" if not node else "-") # +
See also #59816.
I check children at _ready function, It should not be null

But from logs. These children are not null. And I think there has another issues. Because my dictionary container is null when I trying to got one child and I'm sure that container was initailized. Sorry. Not true
Are you sure it's
nulland not Freed Object?var node := Node.new() print(node) # <Node#3501556037163> print(node == null) # false print(node != null) # true print("+" if node else "-") # + print("+" if not node else "-") # - node.free() print(node) # <Freed Object> print(node == null) # true print(node != null) # false print("+" if node else "-") # + print("+" if not node else "-") # + node = null print(node) # <null> print(node == null) # true print(node != null) # false print("+" if node else "-") # - print("+" if not node else "-") # +See also #59816.
My codes work at beta12. I upgrade engine from beta12 to stable. This issue #59816 comes from alpha version.
Have you checked that the node is null? The tooltip can lie:
Are you certain this node is null? There are some cases when the debugger shows data as null when they are too large
Have you checked that the node is
null? The tooltip can lie:Are you certain this node is null? There are some cases when the debugger shows data as null when they are too large
It's not null. I think it is a debugger issue. I will add more comments when I have a conclusion.
It is a debugger issue. Equations(==, !=) are right!
Minimal reproduction project
no need
Citing CONTRIBUTING.md:
To speed up our work, please upload a minimal project that isolates and reproduces the issue. This is always the best way for us to fix it. We recommend attaching a ZIP file with the minimal project directly to the bug report, by drag and dropping the file in the GitHub edition field. This ensures the file can remain available for a long period of time. Only use third-party file hosts if your ZIP file isn't accepted by GitHub because it's too large.
We recommend always attaching a minimal reproduction project, even if the issue may seem simple to reproduce manually.
Please join a MRP. This will especially help to know if your issue is resolved or not by a PR.
Minimal reproduction project
no need
Citing CONTRIBUTING.md:
To speed up our work, please upload a minimal project that isolates and reproduces the issue. This is always the best way for us to fix it. We recommend attaching a ZIP file with the minimal project directly to the bug report, by drag and dropping the file in the GitHub edition field. This ensures the file can remain available for a long period of time. Only use third-party file hosts if your ZIP file isn't accepted by GitHub because it's too large. We recommend always attaching a minimal reproduction project, even if the issue may seem simple to reproduce manually.
Please join a MRP. This will especially help to know if your issue is resolved or not by a PR.
OK
- Duplicate of https://github.com/godotengine/godot/issues/36801.