diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 96c5944794e..f2400c958fe 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2199,14 +2199,15 @@ static void give_parvert(Object *par, int nr, float vec[3]) } if (use_special_ss_case) { - /* Special case if the last modifier is SS and no constructive modifier - * are in front of it. - */ + /* Special case if the last modifier is SS and no constructive modifier are in front of it. */ CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm; CCGVert *ccg_vert = ccgSubSurf_getVert(ccgdm->ss, SET_INT_IN_POINTER(nr)); - float *co = ccgSubSurf_getVertData(ccgdm->ss, ccg_vert); - add_v3_v3(vec, co); - count++; + /* In case we deleted some verts, nr may refer to inexistent one now, see T42557. */ + if (ccg_vert) { + float *co = ccgSubSurf_getVertData(ccgdm->ss, ccg_vert); + add_v3_v3(vec, co); + count++; + } } else if (CustomData_has_layer(&dm->vertData, CD_ORIGINDEX) && !(em && dm->type == DM_TYPE_EDITBMESH)) |