Skip to content

fix(team): Prevent null dereference in TeamFactory::createTeam#534

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

fix(team): Prevent null dereference in TeamFactory::createTeam#534
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-38x-team-create-null-guard

Conversation

@seer-by-sentry

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

Copy link
Copy Markdown

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

Issue:
TeamFactory::createTeam would cause an EXCEPTION_ACCESS_VIOLATION_READ if createInactiveTeam(name) returned nullptr. This happened when a script (e.g., via ScriptActions::doCreateObject) attempted to create a team using a name for which no TeamPrototype existed.

Root Cause:
createTeam unconditionally called t->setActive() on the Team* t returned by createInactiveTeam. When createInactiveTeam returned nullptr (due to a missing prototype), this resulted in a null dereference.

Fix:
Added a null check for the Team* returned by createInactiveTeam before calling setActive(). If createInactiveTeam returns nullptr, createTeam now safely returns nullptr as well. Callers like ScriptActions::doCreateObject already contain logic to handle a nullptr return from createTeam by logging a warning and returning, thus preventing the crash.

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