summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2020-01-15 16:32:44 -0800
committerclayjohn <claynjohn@gmail.com>2020-01-15 21:40:05 -0800
commitf1d0c391c76402aadb9561180669e236805b5741 (patch)
tree30ee4018ff6b6e6a97c95c8011219bfcc827adda /drivers/gles3
parent40f0649e5b02037cb4745c336170e1e5422467ed (diff)
fix light related crashes
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 1be0c46668..03d5763299 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1887,8 +1887,8 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
const RID *lights = e->instance->light_instances.ptr();
for (int i = 0; i < lc; i++) {
- LightInstance *li = light_instance_owner.getptr(lights[i]);
- if (li->last_pass != render_pass) //not visible
+ LightInstance *li = light_instance_owner.getornull(lights[i]);
+ if (!li || li->last_pass != render_pass) //not visible
continue;
if (li && li->light_ptr->type == VS::LIGHT_OMNI) {