### Godot version

4.0.dev (c309de53997feff3286295fb2d71657f112a15db)

### System information

Linux, Nvidia, Vulkan

### Issue description

Editor segfaults when certain conditions are met when using the AnimationPlayer editor.

### Steps to reproduce

1. Create multiple animations, saved into a animation collection
2. Open an existing animation, then make a new empty animation
3. Change from seconds to fps, or add a new property to animate ()
4. Editor crashes

NOTE: It is slightly random and I have not found a perfect repro

### Minimal reproduction project

N/A (TBD?)
{
				float time_min = 0;
				float time_max = animation->get_length();
				for (int i = 0; i < animation->get_track_count(); i++) {
					if (animation->track_get_key_count(i) > 0) {
						float beg = animation->track_get_key_time(i, 0);
						if (beg < time_min) {
							time_min = beg;
						}
						float end = animation->track_get_key_time(i, animation->track_get_key_count(i) - 1);
						if (end > time_max) {
							time_max = end;
						}
					}
				}
				float extra = (zoomw / scale) * 0.5;
				time_max += extra;
				set_min(time_min);
				set_max(time_max);
				if (zoomw / scale < (time_max - time_min)) {
					hscroll->show();
				} else {
					hscroll->hide();
				}
			}
			set_page(zoomw / scale);
			int end_px = (l - get_value()) * scale;
			int begin_px = -get_value() * scale;
			Color notimecol = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
			Color timecolor = color;