Pārlūkot izejas kodu

Fixes crash related to animatio editor, closes #8687

Juan Linietsky 8 gadi atpakaļ
vecāks
revīzija
cf2fdcb63e
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      editor/animation_editor.cpp

+ 2 - 2
editor/animation_editor.cpp

@@ -1299,7 +1299,7 @@ void AnimationKeyEditor::_track_editor_draw() {
 		Object *obj = NULL;
 
 		RES res;
-		Node *node = root->get_node_and_resource(animation->track_get_path(idx), res);
+		Node *node = root ? root->get_node_and_resource(animation->track_get_path(idx), res) : (Node *)NULL;
 
 		if (res.is_valid()) {
 			obj = res.ptr();
@@ -1324,7 +1324,7 @@ void AnimationKeyEditor::_track_editor_draw() {
 
 		te->draw_texture(type_icon[animation->track_get_type(idx)], ofs + Point2(0, y + (h - type_icon[0]->get_height()) / 2).floor());
 		NodePath np = animation->track_get_path(idx);
-		Node *n = root->get_node(np);
+		Node *n = root ? root->get_node(np) : (Node *)NULL;
 		Color ncol = color;
 		if (n && editor_selection->is_selected(n))
 			ncol = track_select_color;