diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index 784851861e8..d263b129047 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -1287,7 +1287,10 @@ void WaterRenderObjClass::replaceSkyboxTexture(const AsciiString& oldTexName, co { W3DAssetManager* assetManager = ((W3DAssetManager*)W3DAssetManager::Get_Instance()); - assetManager->replacePrototypeTexture(m_skyBox, oldTexName.str(), newTextName.str()); + if (m_skyBox) + { + assetManager->replacePrototypeTexture(m_skyBox, oldTexName.str(), newTextName.str()); + } //Enable clamping on all textures used by the skybox (to reduce corner seams). if (m_skyBox && m_skyBox->Class_ID() == RenderObjClass::CLASSID_MESH) diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index e9599a7a256..dfe22e30bc8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -1310,7 +1310,10 @@ void WaterRenderObjClass::replaceSkyboxTexture(const AsciiString& oldTexName, co { W3DAssetManager* assetManager = ((W3DAssetManager*)W3DAssetManager::Get_Instance()); - assetManager->replacePrototypeTexture(m_skyBox, oldTexName.str(), newTextName.str()); + if (m_skyBox) + { + assetManager->replacePrototypeTexture(m_skyBox, oldTexName.str(), newTextName.str()); + } //Enable clamping on all textures used by the skybox (to reduce corner seams). if (m_skyBox && m_skyBox->Class_ID() == RenderObjClass::CLASSID_MESH)