Merge pull request #32530 from Relintai/fix_potential_crash_in_animation_player

Fix potential crash in AnimationPlayer
This commit is contained in:
Rémi Verschelde 2019-10-04 07:36:39 +02:00 committed by GitHub
commit 01c48aba42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}