diff --git a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp index 963b21a3c7c..40ce44e7058 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -2952,6 +2952,9 @@ void Drawable::drawBombed(const IRegion2D* healthBarRegion) const Object *obj = getObject(); + // Check if object is valid before accessing it + if (!obj) + return; UnsignedInt now = TheGameLogic->getFrame(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp index 84125db6ac2..f05cd4cdc9d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp @@ -3457,6 +3457,9 @@ void Drawable::drawBombed(const IRegion2D* healthBarRegion) const Object* obj = getObject(); + // Check if object is valid before accessing it + if (!obj) + return; UnsignedInt now = TheGameLogic->getFrame();