summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHilderin <81109165+Hilderin@users.noreply.github.com>2024-07-21 13:26:15 -0400
committerHilderin <81109165+Hilderin@users.noreply.github.com>2024-07-21 13:26:15 -0400
commit650981a080f876bb42517c82ef46dff05e6d8dc4 (patch)
tree8289e6f7c6580097c39b3f25c2c1c4005ebc6e1e
parente25f3c0d38d457b15a63720240736f564ce0501b (diff)
downloadredot-engine-650981a080f876bb42517c82ef46dff05e6d8dc4.tar.gz
Fix editor crash when editor settings resource is invalid
-rw-r--r--editor/editor_settings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 4107048375..1cf3a4e0c4 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1063,13 +1063,13 @@ void EditorSettings::create() {
}
singleton = ResourceLoader::load(config_file_path, "EditorSettings");
- singleton->set_path(get_newest_settings_path()); // Settings can be loaded from older version file, so make sure it's newest.
-
if (singleton.is_null()) {
ERR_PRINT("Could not load editor settings from path: " + config_file_path);
+ config_file_path = get_newest_settings_path();
goto fail;
}
+ singleton->set_path(get_newest_settings_path()); // Settings can be loaded from older version file, so make sure it's newest.
singleton->save_changed_setting = true;
print_verbose("EditorSettings: Load OK!");