From 0c585f5eda53e4945a5be75e905af7f63e94a919 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Mon, 7 Sep 2026 23:02:06 +0000 Subject: [PATCH] fix(team): Prevent null dereference in TeamFactory::createTeam --- Generals/Code/GameEngine/Source/Common/RTS/Team.cpp | 1 + GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp index c9016d189ad..ed6b506dfe7 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -366,6 +366,7 @@ Team *TeamFactory::createTeam(const AsciiString& name) { Team *t = NULL; t = createInactiveTeam(name); + if (!t) return nullptr; t->setActive(); return t; } diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp index 30c8f077215..2d8289e149c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -366,6 +366,7 @@ Team *TeamFactory::createTeam(const AsciiString& name) { Team *t = NULL; t = createInactiveTeam(name); + if (!t) return nullptr; t->setActive(); return t; }