Fix loading screen hanging on map parsing errors#782
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures the loading screen no longer hangs if map parsing errors occur by moving the error-display setup into the main menu initialization, and it enriches existing debug assertions with descriptive messages.
- Changed how and when
DisplayErrorActionis assigned to prevent hangs on startup. - Updated
Debug.Assertcalls to include explanatory messages in two channel‐related files. - Tweaked exception logging null safety and made
HandleExceptionpublicly accessible.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| DXMainClient/PreStartup.cs | Added null-conditional on TargetSite.Name, made HandleException public, used named parameter for clarity. |
| DXMainClient/Online/Channel.cs | Updated comment and added message string to Debug.Assert for users collection. |
| DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs | Added message string to Debug.Assert in RefreshPlayerList. |
| DXMainClient/DXGUI/Generic/MainMenu.cs | Moved DisplayErrorAction assignment into PostInit to defer error dialogs. |
| DXMainClient/DXGUI/GameClass.cs | Removed previous DisplayErrorAction assignment from Initialize. |
Comments suppressed due to low confidence (2)
DXMainClient/PreStartup.cs:244
- Changing
HandleExceptionfromstatic(package‐private) topublic staticalters the class's API surface. Confirm this exposure is intentional and update any documentation or consumers accordingly.
public static void HandleException(object sender, Exception ex)
DXMainClient/DXGUI/Generic/MainMenu.cs:656
- This new error‐display behavior should be covered by unit or integration tests to verify that errors during map parsing invoke this
DisplayErrorActionand that the application handlesexitcorrectly.
MainClientConstants.DisplayErrorAction = (title, error, exit) =>
|
Nightly build for this pull request:
|
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.
This PR contains partial fix from #718
Debug.Assert