### 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)
float safe_offset = p_offset;
	bool prioritizing_right = p_prioritize_right;
	for (int i = 0; i < curve->get_point_count(); i++) {
		if (i == p_current_index) {
			continue;
		}
		if (curve->get_point_position(i).x > safe_offset) {
			break;
		}
		if (curve->get_point_position(i).x == safe_offset) {
			if (prioritizing_right) {
				safe_offset += 0.00001;
				if (safe_offset > 1.0) {
					safe_offset = 1.0;
					prioritizing_right = false;
				}
			} else {
				safe_offset -= 0.00001;
				if (safe_offset < 0.0) {
					safe_offset = 0.0;
					prioritizing_right = true;
				}
			}
			i = -1;
		}
	}
	return safe_offset;
}
void CurveEdit::add_point(Vector2 p_pos) {