From 3509daa1c1910bf1b2ce8fcbee2e5644b2b3d607 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 3 May 2012 10:56:35 +0000 Subject: [PATCH] Fix #31178, the cause is hidden and selected faces would return NULL as UVElements. To avoid checking the whole contingency of UV synch selection + face selection + face hidden, added a NULL check. --- source/blender/editors/uvedit/uvedit_smart_stitch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 183f75c6b42..9474ae95c34 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1179,13 +1179,13 @@ static int stitch_init(bContext *C, wmOperator *op) } else { BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { - i = 0; - BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { + BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) { if (uvedit_uv_select_test(em, scene, l)) { UvElement *element = ED_uv_element_get(state->element_map, efa, l); - stitch_select_uv(element, state, 1); + if (element) { + stitch_select_uv(element, state, 1); + } } - i++; } } }