From 2bb9b2c54962ab27db02dd94b495faf73885a607 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 31 Mar 2026 11:28:07 +1100 Subject: [PATCH] fix: Ensure container exists when checking if a specific rider is free to exit --- .../Source/GameLogic/Object/Contain/TransportContain.cpp | 2 +- .../Source/GameLogic/Object/Contain/TransportContain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index 7c533936c5b..38634494fc2 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -460,7 +460,7 @@ Bool TransportContain::isSpecificRiderFreeToExit(Object* specificObject) // TheSuperHackers @bugfix Stubbjax 02/03/2026 If our parent container is held, then we // are not free to exit. DEBUG_ASSERTCRASH(specificObject->getContainedBy(), ("rider must be contained")); - if (specificObject->getContainedBy()->isDisabledByType(DISABLED_HELD)) + if (specificObject->getContainedBy() && specificObject->getContainedBy()->isDisabledByType(DISABLED_HELD)) return FALSE; #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index fe364eee869..3e84a6eb135 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -571,7 +571,7 @@ Bool TransportContain::isSpecificRiderFreeToExit(Object* specificObject) // TheSuperHackers @bugfix Stubbjax 02/03/2026 If our parent container is held, then we // are not free to exit. DEBUG_ASSERTCRASH(specificObject->getContainedBy(), ("rider must be contained")); - if (specificObject->getContainedBy()->isDisabledByType(DISABLED_HELD)) + if (specificObject->getContainedBy() && specificObject->getContainedBy()->isDisabledByType(DISABLED_HELD)) return FALSE; #endif