Преглед на файлове

Always create global class list, even if empty

Fixes #72451.
Rémi Verschelde преди 2 години
родител
ревизия
38a806e13f
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      core/config/project_settings.cpp
  2. 1 1
      editor/editor_file_system.cpp

+ 1 - 1
core/config/project_settings.cpp

@@ -1138,7 +1138,7 @@ Array ProjectSettings::get_global_class_list() {
 	Ref<ConfigFile> cf;
 	Ref<ConfigFile> cf;
 	cf.instantiate();
 	cf.instantiate();
 	if (cf->load(get_global_class_list_path()) == OK) {
 	if (cf->load(get_global_class_list_path()) == OK) {
-		script_classes = cf->get_value("", "list");
+		script_classes = cf->get_value("", "list", Array());
 	} else {
 	} else {
 #ifndef TOOLS_ENABLED
 #ifndef TOOLS_ENABLED
 		// Script classes can't be recreated in exported project, so print an error.
 		// Script classes can't be recreated in exported project, so print an error.

+ 1 - 1
editor/editor_file_system.cpp

@@ -1593,7 +1593,7 @@ void EditorFileSystem::_update_pending_script_classes() {
 		_update_script_classes();
 		_update_script_classes();
 	} else {
 	} else {
 		// In case the class cache file was removed somehow, regenerate it.
 		// In case the class cache file was removed somehow, regenerate it.
-		if (ScriptServer::has_global_classes() && !FileAccess::exists(ScriptServer::get_global_class_cache_file_path())) {
+		if (!FileAccess::exists(ScriptServer::get_global_class_cache_file_path())) {
 			ScriptServer::save_global_classes();
 			ScriptServer::save_global_classes();
 		}
 		}
 	}
 	}