fix for knife tool crash when knife_make_chain_cut() couldn't create a new face.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 19 Mar 2013 21:37:22 +0000 (21:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 19 Mar 2013 21:37:22 +0000 (21:37 +0000)
source/blender/editors/mesh/editmesh_knife.c

index b5b6a92cbf5326a04750d33f9e68c158c408c448..e52b1e5c372360158d145c18b54c848c09954ee2 100644 (file)
@@ -2740,10 +2740,16 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
                        kfe = ((Ref *)sidechain->first)->ref;
                        if (knife_edge_in_face(kcd, kfe, f)) {
                                knife_make_chain_cut(kcd, f, sidechain, &fnew2);
+                               if (fnew2 == NULL) {
+                                       return;
+                               }
                                fhole = f;
                        }
                        else if (knife_edge_in_face(kcd, kfe, fnew)) {
                                knife_make_chain_cut(kcd, fnew, sidechain, &fnew2);
+                               if (fnew2 == NULL) {
+                                       return;
+                               }
                                fhole = fnew2;
                        }
                        else {