M lavos/src/renderer.cpp => lavos/src/renderer.cpp +3 -2
@@ 275,9 275,10 @@ void Renderer::UpdateShadowDescriptors(LightCollection *light_collection)
{
vk::ImageView image_view;
vk::Sampler sampler;
- if(i < light_collection->spot_lights.size())
+ SpotLightShadow *shadow;
+ if(i < light_collection->spot_lights.size()
+ && (shadow = light_collection->spot_lights[i]->GetShadow()))
{
- SpotLightShadow *shadow = light_collection->spot_lights[i]->GetShadow();
image_view = shadow->GetFinalImageView();
sampler = shadow->GetSampler();
}