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; }