diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index 506bd89d73d..52f4a3c2e7d 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -812,7 +812,7 @@ std::optional BKE_attributes_active_name_get(AttributeOw } if (owner.type() != AttributeOwnerType::Mesh) { bke::AttributeStorage &storage = *owner.get_storage(); - if (active_index >= storage.count()) { + if (!IndexRange(storage.count()).contains(active_index)) { return std::nullopt; } return storage.at_index(active_index).name();