### 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)
} else {
						curve->set_point_right_tangent(selected_index, tangent);
						if (selected_index != 0 && curve->get_point_left_mode(selected_index) != Curve::TANGENT_LINEAR) {
							curve->set_point_left_tangent(selected_index, mm->is_shift_pressed() ? initial_grab_left_tangent : tangent);
						}
					}
				}
			}
		} else {
			
			hovered_index = get_point_at(mpos);
			hovered_tangent_index = get_tangent_at(mpos);
			queue_redraw();
		}
	}
}
void CurveEdit::use_preset(int p_preset_id) {
	ERR_FAIL_COND(p_preset_id < 0 || p_preset_id >= PRESET_COUNT);
	ERR_FAIL_COND(curve.is_null());
	Array previous_data = curve->get_data();
	curve->clear_points();
	float min_value = curve->get_min_value();
	float max_value = curve->get_max_value();
	switch (p_preset_id) {
		case PRESET_CONSTANT:
			curve->add_point(Vector2(0, (min_value + max_value) / 2.0));
			curve->add_point(Vector2(1, (min_value + max_value) / 2.0));
			curve->set_point_right_mode(0, Curve::TANGENT_LINEAR);
			curve->set_point_left_mode(1, Curve::TANGENT_LINEAR);
			break;