From c39490cf79dab5ba56c52e574d0edfb59930755b Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 3 Oct 2019 20:42:22 +0200 Subject: [PATCH] Fix potential crash in AnimationPlayer. --- editor/plugins/animation_player_editor_plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 75a7099ec45..80353bab01a 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -484,6 +484,8 @@ double AnimationPlayerEditor::_get_editor_step() const { if (track_editor->is_snap_enabled()) { const String current = player->get_assigned_animation(); const Ref anim = player->get_animation(current); + ERR_FAIL_COND_V(!anim.is_valid(), 0.0); + // Use more precise snapping when holding Shift return Input::get_singleton()->is_key_pressed(KEY_SHIFT) ? anim->get_step() * 0.25 : anim->get_step(); }