diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 6b5dfde0b9f..02d667031a9 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4116,7 +4116,7 @@ void AnimationTrackEditor::_scroll_input(const Ref &p_event) { track_edits[i]->append_to_selection(local_rect); } - if (_get_track_selected() == -1) { //minimal hack to make shortcuts work + if (_get_track_selected() == -1 && track_edits.size() > 0) { //minimal hack to make shortcuts work track_edits[track_edits.size() - 1]->grab_focus(); } } else {