### Godot version

v4.2.dev.custom_build [eca6f0eb5]

### System information

Windows 10, Forward+, NVIDIA GeForce GTX 1050 Ti (31.0.15.3623)

### Issue description

When I edit my .gdshaderinc (a shader include file that I use for glsl shaders) file outside of Godot; and I go back to the Godot editor; it asks me if I want to `resave`, `reload` or `cancel`.
- `Resave` will revert the changes I made outside of Godot.
- `Reload` will use the changes I made outside of Godot.
- `Cancel` will do neither.

So I choose `reload` because I want to use the changes made outside the Godot editor.

However, every time I do, I get the following error message
```
editor\plugins\text_shader_editor.cpp:181 - Condition "shader.is_null()" is true.
```

### Steps to reproduce

- Make a .gdshaderinc file with for example some constants
- Make a .glsl file including the .gdshaderinc file
- Open the project with the Godot editor
- Edit and save the .gdshaderinc file outside of Godot
- Give focus to the Godot editor and choose `resave`
- Observe error

### Minimal reproduction project

This project contains a glsl_shader.glsl including a glsl_include.gdshaderinc file.
[MRP-shader-include-error.zip](https://github.com/godotengine/godot/files/12490157/MRP-shader-include-error.zip)

const Color string_color = EDITOR_GET("text_editor/theme/highlighting/string_color");
	syntax_highlighter->add_color_region("\"", "\"", string_color, false);
	if (warnings_panel) {
		
		warnings_panel->add_theme_font_override("normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("main"), EditorStringName(EditorFonts)));
		warnings_panel->add_theme_font_size_override("normal_font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("main_size"), EditorStringName(EditorFonts)));
	}
}
void ShaderTextEditor::_check_shader_mode() {
	String type = ShaderLanguage::get_shader_type(get_text_editor()->get_text());
	Shader::Mode mode;
	if (type == "canvas_item") {
		mode = Shader::MODE_CANVAS_ITEM;
	} else if (type == "particles") {
		mode = Shader::MODE_PARTICLES;
	} else if (type == "sky") {
		mode = Shader::MODE_SKY;
	} else if (type == "fog") {
		mode = Shader::MODE_FOG;
	} else {
		mode = Shader::MODE_SPATIAL;
	}
	if (shader->get_mode() != mode) {
		set_block_shader_changed(true);
		shader->set_code(get_text_editor()->get_text());
		set_block_shader_changed(false);
		_load_theme_settings();
	}
}
static ShaderLanguage::DataType _get_global_shader_uniform_type(const StringName &p_variable) {