Fix exception at startup w/o default game inst#3863
Merged
HebaruSan merged 1 commit intoJul 21, 2023
Conversation
Member
Author
|
@LunarHackett003 and @Kronosiesium, you can try out a dev build under the Artifacts dropdown here to confirm the fix works: |
Member
Author
|
I would like to ship a hotfix release before this impacts more users; self-reviewing... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems
If you have multiple game instances and no default game instance, the Manage Game Instances window appears at startup. In v1.33.0, this exception is thrown after you select an instance:
There's also a "Check for updates" prompt that will happen every time.
(Everything works fine if "Set as default" is checked for some instance.)
Initially reported by a Discord who prefers to remain anonymous, then Poppa Wheelie on the forum.
Causes
As of #3829, when you have no default instance, we use
GUIConfiguration's constructor to get the window geometry defaults from an instance of the class that doesn't correspond to a real file on disk, meaning itspathfield is null.Main.CurrentInstanceUpdatedalways saves the currentGUIConfigurationobject before loading the next one, but this causes an attempt to write to a null file path with the special instance described aboveGUIConfigurationinstance, which can't saveChanges
GUIConfiguration.Savewill abort ifGUIConfiguration.pathis null or empty, which will prevent the exception from occurringMain.CurrentInstanceUpdated, where it will have a validGUIConfigurationobject and therefore always be able to save your choiceFixes #3862.
We should do a hotfix release after this merged. I'm thinking v1.33.2, "Laplace" Δ.