Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_path() error when calling get_node() #67467

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

timothyqiu
Copy link
Member

When failed, get_node() shows the absolute path of current node by calling get_path(). But get_path() requires the node to be inside the tree. So calling get_node("Not Exists") on a outside-tree node produces error messages like this:

ERROR: Cannot get path of node as it is not in a scene tree.
at: get_path (scene/main/node.cpp:1704)
ERROR: Node not found: "Not Exists" (relative to "").
at: get_node (scene/main/node.cpp:1348)

This PR fixes the extra error message issue and avoids an empty description of the node (relative to "").

@timothyqiu timothyqiu added this to the 4.0 milestone Oct 16, 2022
@timothyqiu timothyqiu requested a review from a team as a code owner October 16, 2022 02:52
Copy link
Member

@mhilbrunner mhilbrunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved iny today's PR meeting

@akien-mga akien-mga merged commit 32548f9 into godotengine:master Oct 31, 2022
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the who-ami-i branch October 31, 2022 10:48
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