diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-11-26 14:12:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-12-03 14:34:17 +0300 |
commit | 73ce35d33258eb43965c58f9aeafa985faa88435 (patch) | |
tree | 0e3d6b76eaaae1e73c37521a39800baa666ea010 | |
parent | 6334f97093d356835c0a5e48a20fd38ee72cdb4d (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.
-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 25d3118b3a9..1f6211cb10b 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.c +++ b/source/blender/editors/mesh/editmesh_mask_extract.c @@ -59,7 +59,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; |