You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
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:
committed by
Hanif Bin Ariffin
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: {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user