Fix: Overlay-Next: Crash on scene without active object

This commit is contained in:
Clément Foucault
2024-08-12 17:24:00 +02:00
parent 461bd0a477
commit fd7c884aef

View File

@@ -371,10 +371,11 @@ bool Instance::object_is_selected(const ObjectRef &ob_ref)
bool Instance::object_is_paint_mode(const Object *object)
{
if (object->type == OB_GREASE_PENCIL && state.object_mode & OB_MODE_WEIGHT_GPENCIL_LEGACY) {
if (object->type == OB_GREASE_PENCIL && (state.object_mode & OB_MODE_WEIGHT_GPENCIL_LEGACY)) {
return true;
}
return (object == state.active_base->object) && (state.object_mode & OB_MODE_ALL_PAINT);
return state.active_base && (object == state.active_base->object) &&
(state.object_mode & OB_MODE_ALL_PAINT);
}
bool Instance::object_is_sculpt_mode(const ObjectRef &ob_ref)