Skip to content

Commit 73935b0

Browse files
fix(team): Prevent null dereference in TeamFactory::createTeam
1 parent b7cfeaf commit 73935b0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • Generals/Code/GameEngine/Source/Common/RTS

Generals/Code/GameEngine/Source/Common/RTS/Team.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ Team *TeamFactory::createInactiveTeam(const AsciiString& name)
364364
// ------------------------------------------------------------------------
365365
Team *TeamFactory::createTeam(const AsciiString& name)
366366
{
367-
Team *t = NULL;
368-
t = createInactiveTeam(name);
369-
t->setActive();
367+
Team *t = createInactiveTeam(name);
368+
if (t)
369+
t->setActive();
370370
return t;
371371
}
372372

0 commit comments

Comments
 (0)