diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 9864608af0..b1675376f2 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -3973,9 +3973,9 @@ Bool GameLogic::findControlBarOverride(const AsciiString& commandSetName, Int sl strcpy(&buf[1], commandSetName.str()); ControlBarOverrideMap::const_iterator it = m_controlBarOverrides.find(buf); - if (it != m_controlBarOverrides.end()) + if (it != m_controlBarOverrides.end() && it->second != nullptr) { - commandButton = it->second; // could be null. + commandButton = it->second; return true; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index bfd91242f0..75703cfa71 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -4743,9 +4743,9 @@ Bool GameLogic::findControlBarOverride(const AsciiString& commandSetName, Int sl strcpy(&buf[1], commandSetName.str()); ControlBarOverrideMap::const_iterator it = m_controlBarOverrides.find(buf); - if (it != m_controlBarOverrides.end()) + if (it != m_controlBarOverrides.end() && it->second != nullptr) { - commandButton = it->second; // could be null. + commandButton = it->second; return true; }