### 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
Node *scene = editor_data.get_edited_scene_root(p_idx);
	if (!scene) {
		return;
	}
	String path = EditorPaths::get_singleton()->get_project_settings_dir().path_join(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg");
	Ref<ConfigFile> cf;
	cf.instantiate();
	Dictionary md;
	if (p_idx < 0 || editor_data.get_edited_scene() == p_idx) {
		md = editor_data.get_editor_plugin_states();
	} else {
		md = editor_data.get_scene_editor_states(p_idx);
	}
	List<Variant> keys;
	md.get_key_list(&keys);
	for (const Variant &E : keys) {
		cf->set_value("editor_states", E, md[E]);
	}
	
	List<Node *> selection = editor_selection->get_full_selected_node_list();
	TypedArray<NodePath> selection_paths;
	for (Node *selected_node : selection) {
		selection_paths.push_back(selected_node->get_path());
	}
	cf->set_value("editor_states", "selected_nodes", selection_paths);
	Error err = cf->save(path);
	ERR_FAIL_COND_MSG(err != OK, "Cannot save config file to '" + path + "'.");
}
bool EditorNode::_find_and_save_resource(Ref<Resource> p_res, HashMap<Ref<Resource>, bool> &processed, int32_t flags) {