### Godot version

4.1.beta1

### System information

macOS 13.3.1 mobile renderer

### Issue description

Trying to open and edit one of my visual shaders now consistently crashes Godot 4.1beta1. 

The shader was made and edited fine in earlier versions of Godot 4 and I'm not certain what is special with this shader (attached below for investigation). Opening and editing other visual shaders works fine for me. The only thing I can think of that this shader uses that other do not is the gradient node, though as I can't open it I'm not sure what else might be going on in it.

### Steps to reproduce

Open the attached visual shader (in any project)

### Minimal reproduction project

[ConnectBlendShader.tres.zip](https://www.lostminds.com/godot/ConnectBlendShader.tres.zip)
hovered_index = -1;
				hovered_tangent_index = TANGENT_NONE;
			}
			accept_event();
		}
		if (k->get_keycode() == Key::SHIFT || k->get_keycode() == Key::ALT) {
			queue_redraw(); 
		}
	}
	Ref<InputEventMouseButton> mb = p_event;
	if (mb.is_valid() && mb->is_pressed()) {
		Vector2 mpos = mb->get_position();
		if (mb->get_button_index() == MouseButton::RIGHT || mb->get_button_index() == MouseButton::MIDDLE) {
			if (mb->get_button_index() == MouseButton::RIGHT && grabbing == GRAB_MOVE) {
				
				curve->set_point_value(selected_index, initial_grab_pos.y);
				curve->set_point_offset(selected_index, initial_grab_pos.x);
				set_selected_index(initial_grab_index);
				hovered_index = get_point_at(mpos);
				grabbing = GRAB_NONE;
			} else {
				
				selected_tangent_index = get_tangent_at(mpos);
				if (selected_tangent_index != TANGENT_NONE) {
					toggle_linear(selected_index, selected_tangent_index);
				} else {
					int point_to_remove = get_point_at(mpos);
					if (point_to_remove != -1) {
						if (grabbing == GRAB_ADD) {
							curve->remove_point(point_to_remove);