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.
This commit is contained in:
Sybren A. Stüvel 2019-11-26 12:12:29 +01:00 committed by Sergey Sharybin
parent 6334f97093
commit 73ce35d332
1 changed files with 1 additions and 1 deletions

View File

@ -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;