Skip to content

fix(options): Prevent crash when Advanced Display window is missing - #631

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-580-options-menu-crash
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-580-options-menu-crash

Conversation

@sentry

@sentry sentry Bot commented Oct 8, 2026

Copy link
Copy Markdown

This PR addresses a fatal EXCEPTION_ACCESS_VIOLATION_READ crash (CLIENT-580) that occurred when opening the Options Menu.

Root Cause:
The OptionsMenuInit function, along with showAdvancedOptions, acceptAdvancedOptions, and cancelAdvancedOptions, would attempt to call winHide(TRUE) on the WinAdvancedDisplay GameWindow pointer without first checking if the pointer was valid. WinAdvancedDisplay could be null if TheWindowManager->winGetWindowFromId(nullptr, "OptionsMenu.wnd:WinAdvancedDisplayOptions") failed to find the specified window in the loaded UI layout (e.g., due to a modified or incomplete OptionsMenu.wnd file).

Fix:
Added null checks for WinAdvancedDisplay before any calls to winHide in:

  • Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp

This ensures that if the WinAdvancedDisplayOptions window is not found in the UI layout, the game will no longer crash, and the Options Menu will simply open without the advanced display panel.

Fixes CLIENT-580

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants