From 5bad311f4ce47194a181d902637299fe26fd17ba Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 12 Sep 2022 14:15:43 -0500 Subject: Fix: Multires crash after recent face set refactor Missing null check when retrieving face sets for multires automasking. Caused by b5f7af31d6d474c3b455b. --- source/blender/editors/sculpt_paint/sculpt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 119bd254abf..65e69bd8761 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -329,8 +329,14 @@ int SCULPT_active_face_set_get(SculptSession *ss) { switch (BKE_pbvh_type(ss->pbvh)) { case PBVH_FACES: - return ss->face_sets ? ss->face_sets[ss->active_face_index] : SCULPT_FACE_SET_NONE; + if (!ss->face_sets) { + return SCULPT_FACE_SET_NONE; + } + return ss->face_sets[ss->active_face_index]; case PBVH_GRIDS: { + if (!ss->face_sets) { + return SCULPT_FACE_SET_NONE; + } const int face_index = BKE_subdiv_ccg_grid_to_face_index(ss->subdiv_ccg, ss->active_grid_index); return ss->face_sets[face_index]; -- cgit v1.2.3