浏览代码

Merge pull request #19631 from guilhermefelipecgs/fix_animation_player_crash

Prevent animation player crash
Rémi Verschelde 7 年之前
父节点
当前提交
08c6cc668a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/animation_track_editor.cpp

+ 1 - 1
editor/animation_track_editor.cpp

@@ -4116,7 +4116,7 @@ void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) {
 					track_edits[i]->append_to_selection(local_rect);
 					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();
 					track_edits[track_edits.size() - 1]->grab_focus();
 				}
 				}
 			} else {
 			} else {