瀏覽代碼

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.
Stefano Bonicatti 7 年之前
父節點
當前提交
cad2fc7ba9
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      editor/scene_tree_editor.cpp

+ 2 - 1
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) {