Skip to content

fix(team): Prevent crash when createInactiveTeam returns null - #551

Open
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-38x-team-factory-crash
Open

fix(team): Prevent crash when createInactiveTeam returns null#551
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-38x-team-factory-crash

Conversation

@seer-by-sentry

@seer-by-sentry seer-by-sentry Bot commented Aug 8, 2026

Copy link
Copy Markdown

This PR addresses CLIENT-38X, a crash in TeamFactory::createTeam.

Root Cause:
The TeamFactory::createTeam function was observed to crash when createInactiveTeam() returned a null pointer, and setActive() was subsequently called on this null pointer. This issue stemmed from an incomplete application (or subsequent reversion) of a previous fix (PR 534 / commit 362de7da). While the null check was correctly applied to Generals/Code/GameEngine/Source/Common/RTS/Team.cpp, it was missing or reverted in the parallel GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp file.

Solution:
Implemented a null check for the return value of createInactiveTeam() before calling setActive() within TeamFactory::createTeam in GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp. The same null check was also verified and re-applied to Generals/Code/GameEngine/Source/Common/RTS/Team.cpp to ensure consistency across both code paths and prevent future regressions.

Fixes CLIENT-38X

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