Fix T88370: GPencil render crash when use viewlayer and masking

When filtering the render using view layer, could be possible the mask is NULL and just need to be ignored.
This commit is contained in:
2021-05-18 15:42:26 +02:00
parent b158477551
commit a9da73ab95

View File

@@ -819,7 +819,10 @@ static void gpencil_draw_mask(GPENCIL_Data *vedata, GPENCIL_tObject *ob, GPENCIL
}
GPENCIL_tLayer *mask_layer = gpencil_layer_cache_get(ob, i);
BLI_assert(mask_layer);
/* When filtering by viewlayer, the mask could be null and must be ignored. */
if (mask_layer == NULL) {
continue;
}
DRW_draw_pass(mask_layer->geom_ps);
}