From e9c1e5aa7ce7d4ff82adcac004833718c89560c0 Mon Sep 17 00:00:00 2001 From: hbina085 Date: Sun, 14 Jul 2019 10:47:24 -0400 Subject: [PATCH] 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 --- editor/scene_tree_dock.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 935946bf246..c43d1640789 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -394,7 +394,11 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!profile_allow_editing) { 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; case TOOL_ATTACH_SCRIPT: {