Fix #143847: Assert in attribute operator poll after refactor

Mistake in fa03c53d4a.
We need to test for negative indices here too.
This commit is contained in:
Hans Goudey
2025-08-07 12:38:27 -04:00
parent 3f94a4ab1c
commit 5925233e4d

View File

@@ -812,7 +812,7 @@ std::optional<blender::StringRefNull> 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();