### 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?)
switch (p_what) {
		case NOTIFICATION_THEME_CHANGED: {
			if (animation.is_null()) {
				return;
			}
			ERR_FAIL_INDEX(track, animation->get_track_count());
			type_icon = _get_key_type_icon();
			selected_icon = get_theme_icon(SNAME("KeySelected"), SNAME("EditorIcons"));
		} break;
		case NOTIFICATION_DRAW: {
			if (animation.is_null()) {
				return;
			}
			ERR_FAIL_INDEX(track, animation->get_track_count());
			int limit = timeline->get_name_limit();
			if (track % 2 == 1) {
				
				draw_rect(Rect2(Point2(1 * EDSCALE, 0), get_size() - Size2(1 * EDSCALE, 0)), Color(0.5, 0.5, 0.5, 0.05));
			}
			if (hovered) {
				
				draw_rect(Rect2(Point2(1 * EDSCALE, 0), get_size() - Size2(1 * EDSCALE, 0)), Color(0.5, 0.5, 0.5, 0.1));
			}
			if (has_focus()) {
				Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
				accent.a *= 0.7;
				
				draw_style_box(get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles")), Rect2(Point2(1 * EDSCALE, 0), get_size() - Size2(1 * EDSCALE, 0)));