### Godot version

 v4.0.beta11.official.91713ced8

### System information

macOS 12.6.1 Monterey, Apple M1 Pro

### Issue description

After reopening scenes with Sprite2D and trying to edit the region of the sprite again the Godot app crashed.

### Steps to reproduce

1. Open scene node_2d in the project files
2. Go to Sprite2D and click on edit region, pop up should show
3. Close the popup and close the scene with X on the tab
4. Reopen the scene, go to Sprite2D and click on Edit region
5. Godot should crash

### Minimal reproduction project

[region_crash.zip](https://github.com/godotengine/godot/files/10400566/region_crash.zip)

break;
			}
		} else {
			filter = CanvasItem::TEXTURE_FILTER_NEAREST_WITH_MIPMAPS;
		}
	}
	if (texture.is_null()) {
		preview_tex->set_diffuse_texture(nullptr);
		_zoom_reset();
		hscroll->hide();
		vscroll->hide();
		edit_draw->queue_redraw();
		return;
	}
	preview_tex->set_texture_filter(filter);
	preview_tex->set_diffuse_texture(texture);
	if (cache_map.has(texture->get_rid())) {
		autoslice_cache = cache_map[texture->get_rid()];
		autoslice_is_dirty = false;
	} else {
		if (is_visible() && snap_mode == SNAP_AUTOSLICE) {
			_update_autoslice();
		} else {
			autoslice_is_dirty = true;
		}
	}
	_update_rect();
	edit_draw->queue_redraw();
}
Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const {