[Bf-blender-cvs] [d5ed3de6545] master: Fix Poly Build crash with empty meshes

Pablo Dobarro noreply at git.blender.org
Tue Aug 27 17:43:56 CEST 2019


Commit: d5ed3de654513f6a53d0db79e912ba179e2833c3
Author: Pablo Dobarro
Date:   Tue Aug 27 17:43:37 2019 +0200
Branches: master
https://developer.blender.org/rBd5ed3de654513f6a53d0db79e912ba179e2833c3

Fix Poly Build crash with empty meshes

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5609

===================================================================

M	source/blender/editors/mesh/editmesh_polybuild.c

===================================================================

diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c
index a182bfeb945..21c850160dd 100644
--- a/source/blender/editors/mesh/editmesh_polybuild.c
+++ b/source/blender/editors/mesh/editmesh_polybuild.c
@@ -136,9 +136,14 @@ static int edbm_polybuild_transform_at_cursor_invoke(bContext *C,
   invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
   ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d);
 
+  if (!ele_act) {
+    return OPERATOR_CANCELLED;
+  }
+
   edbm_selectmode_ensure(vc.scene, vc.em, SCE_SELECT_VERTEX);
 
   edbm_flag_disable_all_multi(vc.view_layer, vc.v3d, BM_ELEM_SELECT);
+
   if (ele_act->head.htype == BM_VERT) {
     BM_vert_select_set(bm, (BMVert *)ele_act, true);
   }
@@ -194,6 +199,10 @@ static int edbm_polybuild_delete_at_cursor_invoke(bContext *C,
   invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
   ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d);
 
+  if (!ele_act) {
+    return OPERATOR_CANCELLED;
+  }
+
   edbm_selectmode_ensure(vc.scene, vc.em, SCE_SELECT_VERTEX);
 
   if (ele_act->head.htype == BM_FACE) {



More information about the Bf-blender-cvs mailing list