diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-07-15 08:37:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-15 08:37:03 +0300 |
commit | eb87b1c8f6d56fc069752e252866bc134ee54e9d (patch) | |
tree | 47fb7e335709810480022a1d25b482f998fa4d6f /source/blender/draw/engines | |
parent | 920b138f83c4b740480c821b640351d41e70ec12 (diff) |
Cleanup: remove assignment from a NULL struct
Quiet ASAN 'member access within null pointer' warning.
While this doesn't crash, access to 'shading'
without checking if the 'v3d' would have.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lookdev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index 18365d69514..b89772441fa 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -107,9 +107,9 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, EEVEE_EffectsInfo *effects = stl->effects; EEVEE_PrivateData *g_data = stl->g_data; const DRWContextState *draw_ctx = DRW_context_state_get(); - View3D *v3d = draw_ctx->v3d; - View3DShading *shading = &v3d->shading; - Scene *scene = draw_ctx->scene; + /* The view will be NULL when rendering previews. */ + const View3D *v3d = draw_ctx->v3d; + const Scene *scene = draw_ctx->scene; const bool probe_render = pinfo != NULL; @@ -150,6 +150,7 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, } if (LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)) { + const View3DShading *shading = &v3d->shading; StudioLight *sl = BKE_studiolight_find(shading->lookdev_light, STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE); if (sl && (sl->flag & STUDIOLIGHT_TYPE_WORLD)) { |