LookDev: Fix crash when no world
authorJeroen Bakker <j.bakker@atmind.nl>
Tue, 5 Jun 2018 13:49:31 +0000 (15:49 +0200)
committerJeroen Bakker <j.bakker@atmind.nl>
Tue, 5 Jun 2018 13:49:54 +0000 (15:49 +0200)
source/blender/draw/engines/eevee/eevee_lookdev.c

index 8107aa33d2b3bd780358275480de0f4fd0f1f79d..8ef52f8c553a68803a620b5408e9c7ab169ab786 100644 (file)
@@ -51,7 +51,9 @@ void EEVEE_lookdev_cache_init(
                        axis_angle_to_mat3_single(stl->g_data->studiolight_matrix, 'Z', v3d->shading.studiolight_rot_z);
                        DRW_shgroup_uniform_mat3(*grp, "StudioLightMatrix", stl->g_data->studiolight_matrix);
 
-                       DRW_shgroup_uniform_vec3(*grp, "color", &world->horr, 1);
+                       if (world) {
+                               DRW_shgroup_uniform_vec3(*grp, "color", &world->horr, 1);
+                       }
                        DRW_shgroup_uniform_float(*grp, "backgroundAlpha", &stl->g_data->background_alpha, 1);
                        DRW_shgroup_call_add(*grp, geom, NULL);
                        if (!pinfo) {