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: {