From cad2fc7ba923f492e4625e02b7cc23500949e9e8 Mon Sep 17 00:00:00 2001 From: Stefano Bonicatti Date: Sun, 10 Dec 2017 22:33:44 +0100 Subject: Fix SceneTreeEditor crashing when calling _deselect_items The crash can be triggered for instance by trying to reparent a node and clicking on the background of the Reparent Node window. --- editor/scene_tree_editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 2c0981ca30..25924212fd 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -484,7 +484,8 @@ void SceneTreeEditor::_selected_changed() { void SceneTreeEditor::_deselect_items() { // Clear currently elected items in scene tree dock. - editor_selection->clear(); + if (editor_selection) + editor_selection->clear(); } void SceneTreeEditor::_cell_multi_selected(Object *p_object, int p_cell, bool p_selected) { -- cgit v1.2.3