From e09f0caff32e61095c3349daa394e1a45b18a893 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Tue, 17 Mar 2020 19:01:51 +0100 Subject: GPencil: Fix crash joining objects The weights array can be NULL. --- source/blender/editors/gpencil/gpencil_data.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/gpencil/gpencil_data.c') diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 13e1be329c7..7ba4637f9d8 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -2627,8 +2627,11 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op) LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { MDeformVert *dvert; int i; + if (gps->dvert == NULL) { + continue; + } for (i = 0, dvert = gps->dvert; i < gps->totpoints; i++, dvert++) { - if ((dvert->dw) && (dvert->dw->def_nr == old_idx)) { + if ((dvert->dw != NULL) && (dvert->dw->def_nr == old_idx)) { dvert->dw->def_nr = idx; } } -- cgit v1.2.3