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:
parent
fa1a946d4f
commit
2d7effc27d
Notes:
blender-bot
2023-02-14 07:31:32 +01:00
Referenced by issue #71932, Crash when type "ext" in search
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue