diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp index 8dd327575c0..21ea6e371e5 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -1492,7 +1492,11 @@ Relationship Team::getRelationship(const Team *that) const } // nope -- go with our Player's view on the matter. - return getControllingPlayer()->getRelationship(that); + // TheSuperHackers @bugfix Mauller 16/03/2026 Guard against null controlling player to prevent access violation + const Player* controllingPlayer = getControllingPlayer(); + if (controllingPlayer == nullptr) + return NEUTRAL; + return controllingPlayer->getRelationship(that); } // ------------------------------------------------------------------------ diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp index 7d28fc8d62b..4bc112feabe 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -1493,7 +1493,11 @@ Relationship Team::getRelationship(const Team *that) const } // nope -- go with our Player's view on the matter. - return getControllingPlayer()->getRelationship(that); + // TheSuperHackers @bugfix Mauller 16/03/2026 Guard against null controlling player to prevent access violation + const Player* controllingPlayer = getControllingPlayer(); + if (controllingPlayer == nullptr) + return NEUTRAL; + return controllingPlayer->getRelationship(that); } // ------------------------------------------------------------------------