Fix crash in sculpt poll function without an active object
This commit is contained in:
@@ -178,9 +178,11 @@ static void SCULPT_OT_optimize(wmOperatorType *ot)
|
||||
static bool sculpt_no_multires_poll(bContext *C)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
const bke::pbvh::Tree *pbvh = bke::object::pbvh_get(*ob);
|
||||
if (SCULPT_mode_poll(C) && ob->sculpt && pbvh) {
|
||||
return pbvh->type() != bke::pbvh::Type::Grids;
|
||||
if (ob) {
|
||||
const bke::pbvh::Tree *pbvh = bke::object::pbvh_get(*ob);
|
||||
if (SCULPT_mode_poll(C) && ob->sculpt && pbvh) {
|
||||
return pbvh->type() != bke::pbvh::Type::Grids;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user