Skip to content

Commit

Permalink
Merge pull request #94593 from Hilderin/fix-crash-editor-invalid-edit…
Browse files Browse the repository at this point in the history
…or-settings

Fix editor crash when editor settings resource is invalid
  • Loading branch information
akien-mga committed Jul 22, 2024
2 parents c0fae76 + 650981a commit 219cd80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down

0 comments on commit 219cd80

Please sign in to comment.