### Godot version

4.1 rc3

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

This™
![image](https://github.com/godotengine/godot/assets/2223172/cb33110f-a5b0-400a-951f-3fa425f05714)

It can still happen, but it's more difficult to trigger.

### Steps to reproduce

1. Create a new scene with a Control node
2. Add Theme to the Control
3. Open Theme Editor
4. Clear the `theme` property in Control
5. Save, with Theme Editor opened
6. Restart

### Minimal reproduction project

N/A
InspectorDock::get_singleton()->edit_resource(p_resource);
}
void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const String &p_path) {
	editor_data.apply_changes_in_editors();
	if (saving_resources_in_path.has(p_resource)) {
		return;
	}
	saving_resources_in_path.insert(p_resource);
	int flg = 0;
	if (EDITOR_GET("filesystem/on_save/compress_binary_resources")) {
		flg |= ResourceSaver::FLAG_COMPRESS;
	}
	String path = ProjectSettings::get_singleton()->localize_path(p_path);
	Error err = ResourceSaver::save(p_resource, path, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
	if (err != OK) {
		if (ResourceLoader::is_imported(p_resource->get_path())) {
			show_accept(TTR("Imported resources can't be saved."), TTR("OK"));
		} else {
			show_accept(TTR("Error saving resource!"), TTR("OK"));
		}
		saving_resources_in_path.erase(p_resource);
		return;
	}
	((Resource *)p_resource.ptr())->set_path(path);
	saving_resources_in_path.erase(p_resource);
	_resource_saved(p_resource, path);
	emit_signal(SNAME("resource_saved"), p_resource);
	editor_data.notify_resource_saved(p_resource);
}
void EditorNode::save_resource(const Ref<Resource> &p_resource) {