Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2019-08-27 18:43:37 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-08-27 18:44:36 +0300
commitd5ed3de654513f6a53d0db79e912ba179e2833c3 (patch)
treeff2592d717bb60918108320a9c1ab117cd89391f /source/blender/editors/mesh/editmesh_polybuild.c
parent6d37654ce8e0d442741d284bb36536aa75078c33 (diff)
Fix Poly Build crash with empty meshes
Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D5609
Diffstat (limited to 'source/blender/editors/mesh/editmesh_polybuild.c')
-rw-r--r--source/blender/editors/mesh/editmesh_polybuild.c9
1 files changed, 9 insertions, 0 deletions
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) {