Fix crash when changing Node type
Prevent the application from crashing by simply checking if current "selection" is not null before accessing it. Fixes #30493
This commit is contained in:
parent
584ca0f156
commit
e9c1e5aa7c
|
@ -394,7 +394,11 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
||||||
if (!profile_allow_editing) {
|
if (!profile_allow_editing) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
create_dialog->popup_create(false, true, scene_tree->get_selected()->get_class());
|
|
||||||
|
Node *selected = scene_tree->get_selected();
|
||||||
|
if (selected)
|
||||||
|
create_dialog->popup_create(false, true, selected->get_class());
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case TOOL_ATTACH_SCRIPT: {
|
case TOOL_ATTACH_SCRIPT: {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue