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

Don't create bones from empty scene #77473

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented May 25, 2023

Make bones operation for whatever reason included this esoteric line:

Node *editor_root = EditorNode::get_singleton()->get_edited_scene()->get_tree()->get_edited_scene_root();

The fun part is that get_edited_scene() and get_edited_scene_root() return the same node xd

I also added an early return, because it's pointless trying to make bones if there are no nodes.

Fixes #77359

@fire fire requested review from a team May 25, 2023 13:51
@akien-mga akien-mga merged commit 2eec9a6 into godotengine:master May 25, 2023
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_root().get_tree().get_edited_scene_root() branch May 25, 2023 14:13
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.4.

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.

Editor crashes after Ctrl + Shift + B on new tab (2D Workspace)
3 participants