fix [#27271] Going into sculpt mode causes crash
[blender.git] / source / blender / blenkernel / intern / DerivedMesh.c
index 7d3219d917e3879019187be57402fc2ea1bad35b..297489ee56fd3eeadd6e98c8cc405e1421129d7c 100644 (file)
@@ -1815,7 +1815,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                         * to avoid giving bogus normals to the next modifier see: [#23673] */
                        if(isPrevDeform &&  mti->dependsOnNormals && mti->dependsOnNormals(md)) {
                                /* XXX, this covers bug #23673, but we may need normal calc for other types */
-                               if(dm->type == DM_TYPE_CDDM) {
+                               if(dm && dm->type == DM_TYPE_CDDM) {
                                        CDDM_apply_vert_coords(dm, deformedVerts);
                                        CDDM_calc_normals(dm);
                                }