From ecebf94e2568bd82ac61d36e43c61d7e8e4bf1ba Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 5 Jul 2024 11:26:18 -0400 Subject: [PATCH] Fix #124212: Edit mode undo crash with no faces Just a missing null check here. Caused by 734e9fa4b82cf8f6e291fc0e9755bafec1548c61. --- source/blender/editors/mesh/editmesh_undo.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_undo.cc b/source/blender/editors/mesh/editmesh_undo.cc index 8ce3afcac97..bc531661e78 100644 --- a/source/blender/editors/mesh/editmesh_undo.cc +++ b/source/blender/editors/mesh/editmesh_undo.cc @@ -360,8 +360,9 @@ static void um_arraystore_cd_free(BArrayCustomData *bcd, const int bs_index) BArrayStore *bs = BLI_array_store_at_size_get(&um_arraystore.bs_stride[bs_index], stride); for (int i = 0; i < bcd->states.size(); i++) { if (std::holds_alternative(bcd->states[i])) { - BArrayState *state = std::get(bcd->states[i]); - BLI_array_store_state_remove(bs, state); + if (BArrayState *state = std::get(bcd->states[i])) { + BLI_array_store_state_remove(bs, state); + } } else { ImplicitSharingInfoAndData state = std::get(bcd->states[i]);