### Godot version

4.0.2

### System information

Windows 10,Radeon RX 550/550 Series,23.3.2,Vulkan

### Issue description

After Switching to the animations tabs and pressing the key symbol because I wanted to know what it does, Godot crashes

### Steps to reproduce

Go into a project 
Switch to the Animations Tab, make sure no animation is active 
And then press on the key symbol

here is a video demonstrating the bug

https://user-images.githubusercontent.com/59411880/233839816-5489899e-828f-4ac9-9de3-7914f727f754.mp4



### Minimal reproduction project

The File
[package.zip](https://github.com/godotengine/godot/files/11303712/package.zip)

viewport->draw_rect(y_handle_rect, get_theme_color(SNAME("axis_y_color"), SNAME("Editor")));
					viewport->draw_line(Point2(), Point2(0, scale_factor.y * EDSCALE), get_theme_color(SNAME("axis_y_color"), SNAME("Editor")), Math::round(EDSCALE));
					viewport->draw_set_transform_matrix(viewport->get_transform());
				}
			}
		}
	}
	if (drag_type == DRAG_BOX_SELECTION) {
		// Draw the dragging box
		Point2 bsfrom = transform.xform(drag_from);
		Point2 bsto = transform.xform(box_selecting_to);
		viewport->draw_rect(
				Rect2(bsfrom, bsto - bsfrom),
				get_theme_color(SNAME("box_selection_fill_color"), SNAME("Editor")));
		viewport->draw_rect(
				Rect2(bsfrom, bsto - bsfrom),
				get_theme_color(SNAME("box_selection_stroke_color"), SNAME("Editor")),
				false,
				Math::round(EDSCALE));
	}
	if (drag_type == DRAG_ROTATE) {
		// Draw the line when rotating a node
		viewport->draw_line(
				transform.xform(drag_rotation_center),
				transform.xform(drag_to),
				get_theme_color(SNAME("accent_color"), SNAME("Editor")) * Color(1, 1, 1, 0.6),
				Math::round(2 * EDSCALE));
	}
}
void CanvasItemEditor::_draw_straight_line(Point2 p_from, Point2 p_to, Color p_color) {