From 38a806e13f294ae8d583b21b3c6b9d20320386d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 31 Jan 2023 15:28:53 +0100 Subject: [PATCH] Always create global class list, even if empty Fixes #72451. --- core/config/project_settings.cpp | 2 +- editor/editor_file_system.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index b63fbde7a01..ba9c6e4c601 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1138,7 +1138,7 @@ Array ProjectSettings::get_global_class_list() { Ref cf; cf.instantiate(); if (cf->load(get_global_class_list_path()) == OK) { - script_classes = cf->get_value("", "list"); + script_classes = cf->get_value("", "list", Array()); } else { #ifndef TOOLS_ENABLED // Script classes can't be recreated in exported project, so print an error. diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 4d0ef3fe8d9..644c32e8a40 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1593,7 +1593,7 @@ void EditorFileSystem::_update_pending_script_classes() { _update_script_classes(); } else { // 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(); } }