diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-04 07:36:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-04 07:36:39 +0200 |
commit | 01c48aba42a63bd021552b892784a0c1e71a75ec (patch) | |
tree | 0ac81fca4e271cb7845227154a83fe519ad1e4ec | |
parent | 00417675fa186103ddfcaa37807d4c2819f709e2 (diff) | |
parent | c39490cf79dab5ba56c52e574d0edfb59930755b (diff) |
Merge pull request #32530 from Relintai/fix_potential_crash_in_animation_player
Fix potential crash in AnimationPlayer
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 75a7099ec4..80353bab01 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<Animation> 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(); } |