From 5d0ccaba8b5c4b56586cafb61dac5c029c39bec0 Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 21:22:43 +0000 Subject: [PATCH] bugfix(gui): Prevent null pointer dereference in WOLQuickMatchMenu --- .../GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index b58e6db9039..15ca5b68a7a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -1117,10 +1117,15 @@ void WOLQuickMatchMenuInit( WindowLayout *layout, void *userData ) NGMP_OnlineServices_LobbyInterface* pLobbyInterface = NGMP_OnlineServicesManager::GetInterface(); // cannot connect to the lobby we joined + if (pLobbyInterface != nullptr) + { + pLobbyInterface->RegisterForCannotConnectToLobbyCallback([](void) { // TODO_QUICKMATCH: Show error message + stop matchmaking + enable buttons again }); + } + // get playlist list NGMP_OnlineServices_MatchmakingInterface* pMatchmakingInterface = NGMP_OnlineServicesManager::GetInterface(); @@ -1331,12 +1336,14 @@ void WOLQuickMatchMenuInit( WindowLayout *layout, void *userData ) buttonText.format(L"%s", TheGameText->fetch("GUI:Buddies").str()); } buttonBuddies->winSetText(buttonText); + + } }); } // And also initialize it - if (buttonBuddies != nullptr && pSocialInterface->GetNumTotalNotifications() > 0) + if (buttonBuddies != nullptr && pSocialInterface != nullptr && pSocialInterface->GetNumTotalNotifications() > 0) { UnicodeString buttonText; buttonText.format(L"%s [%d]", TheGameText->fetch("GUI:Buddies").str(), pSocialInterface->GetNumTotalNotifications()); @@ -2489,4 +2496,5 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms return MSG_HANDLED; } +