diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-25 18:03:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-25 18:03:36 +0300 |
commit | c8fb984ee6445f5bc80bceacdec604c8d392d0f9 (patch) | |
tree | ad913591b67caa2ccfb3bbd79d1f1d8c2cd70930 | |
parent | 2d0a1f4de218105d64680922aef1f247eda358b3 (diff) |
bugfix [#24916] Blender Crash after inappropriate Merge-Command
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index eb450c7434b..2a04859f462 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5841,6 +5841,7 @@ static int merge_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); int count= 0, uvs= RNA_boolean_get(op->ptr, "uvs"); + EditSelection *ese; switch(RNA_enum_get(op->ptr, "type")) { case 3: @@ -5850,10 +5851,21 @@ static int merge_exec(bContext *C, wmOperator *op) count = merge_target(C, em, 1, uvs); break; case 1: - count = merge_firstlast(em, 0, uvs); + ese= (EditSelection *)em->selected.last; + if(ese && ese->type == EDITVERT) { + count = merge_firstlast(em, 0, uvs); + } else { + BKE_report(op->reports, RPT_ERROR, "no last selected vertex set"); + } break; case 6: - count = merge_firstlast(em, 1, uvs); + ese= (EditSelection *)em->selected.first; + if(ese && ese->type == EDITVERT) { + count = merge_firstlast(em, 1, uvs); + } + else { + BKE_report(op->reports, RPT_ERROR, "no last selected vertex set"); + } break; case 5: count = collapseEdges(em); |