diff options
| author | Juan Linietsky | 2017-08-15 19:05:13 -0300 |
|---|---|---|
| committer | Rémi Verschelde | 2017-08-27 12:26:07 +0200 |
| commit | f6575f8d9a89241affb0bdc995189f4a29072f4e (patch) | |
| tree | 017ffdce0b4da881fd3029bdf635757962bd0547 /editor/animation_editor.cpp | |
| parent | da15a1b50dbec2726a4a942772eb989c21958279 (diff) | |
| download | godot-f6575f8d9a89241affb0bdc995189f4a29072f4e.tar.gz godot-f6575f8d9a89241affb0bdc995189f4a29072f4e.tar.zst godot-f6575f8d9a89241affb0bdc995189f4a29072f4e.zip | |
Fixes crash related to animatio editor, closes #8687
(cherry picked from commit cf2fdcb63e9b7be6b2aab2e9e0989cbd9aca704b)
Diffstat (limited to '')
| -rw-r--r-- | editor/animation_editor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index 51a1a228d..0627e1efd 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -1294,7 +1294,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(); @@ -1319,7 +1319,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; |
