diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-11-26 14:12:29 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-11-26 14:12:29 +0300 |
commit | 2d7effc27d8b893c2e650079203c1451c82d8e5b (patch) | |
tree | a7e63035190c32d888e65c6eb49d93a290991ab4 /source | |
parent | fa1a946d4f3a5e8d010b7eee0a2d93e774fb0009 (diff) |
Fix segfault when polling `MESH_OT_paint_mask_extract`
`CTX_data_active_object(C)` returns `NULL` when there is no active object,
and this was not tested for in the code.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mask_extract.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c b/source/blender/editors/mesh/editmesh_mask_extract.c index 40430bccf16..0d886360253 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.c +++ b/source/blender/editors/mesh/editmesh_mask_extract.c @@ -61,7 +61,7 @@ static bool paint_mask_extract_poll(bContext *C) { Object *ob = CTX_data_active_object(C); - if (ob->mode == OB_MODE_SCULPT) { + if (ob != NULL && ob->mode == OB_MODE_SCULPT) { if (ob->sculpt->bm) { CTX_wm_operator_poll_msg_set(C, "The mask can not be extracted with dyntopo activated."); return false; |