Fixed possible crash.

This commit is contained in:
Nissim Hadar 2018-02-14 18:55:04 -08:00
parent be940493cc
commit a679b6f828

View file

@ -550,7 +550,9 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
if (lightStage && lightStage->_currentFrame._sunLights.size()) {
graphics::LightPointer keyLight = lightStage->getLight(lightStage->_currentFrame._sunLights.front());
keyLightCastShadows = keyLight->getCastShadows();
if (keyLight) {
keyLightCastShadows = keyLight->getCastShadows();
}
}
if (deferredLightingEffect->_shadowMapEnabled && keyLightCastShadows) {