### 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 Vector<ShaderLanguage::ModeInfo> &modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()));
		for (int i = 0; i < modes.size(); i++) {
			const ShaderLanguage::ModeInfo &mode_info = modes[i];
			if (!mode_info.options.is_empty()) {
				for (int j = 0; j < mode_info.options.size(); j++) {
					built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[j]));
				}
			} else {
				built_ins.push_back(String(mode_info.name));
			}
		}
	}
	const Color user_type_color = EDITOR_GET("text_editor/theme/highlighting/user_type_color");
	for (const String &E : built_ins) {
		syntax_highlighter->add_keyword_color(E, user_type_color);
	}
	
	const Color comment_color = EDITOR_GET("text_editor/theme/highlighting/comment_color");
	syntax_highlighter->clear_color_regions();
	syntax_highlighter->add_color_region("/*", "*/", comment_color, false);
	syntax_highlighter->add_color_region("//", "", comment_color, true);
	
	syntax_highlighter->set_disabled_branch_color(Color(EDITOR_GET("text_editor/theme/highlighting/text_color")) * Color(1, 1, 1, 0.5));
	te->clear_comment_delimiters();
	te->add_comment_delimiter("/*", "*/", false);
	te->add_comment_delimiter("//", "", true);
	if (!te->has_auto_brace_completion_open_key("/*")) {
		te->add_auto_brace_completion_pair("/*", "*/");
	}