GPencil: Fix unreported crash when style is NULL

This commit is contained in:
Antonio Vazquez 2020-11-11 11:31:33 +01:00
parent 7b6d76f387
commit e47ea9fbc7
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob)
tgp_ob->do_mat_holdout = false;
for (int i = 0; i < ob->totcol; i++) {
MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, i + 1);
if ((gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT) ||
if ((gp_style != NULL) && (gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT) ||
((gp_style->flag & GP_MATERIAL_IS_FILL_HOLDOUT))) {
tgp_ob->do_mat_holdout = true;
break;