Ensure that Attribute::required() doesnt work with NULL $this->schema. Avoids issue as reported by #306

This commit is contained in:
Deon George 2025-04-04 20:48:02 +11:00
parent eab4f0427c
commit a57ee78492

View File

@ -326,7 +326,7 @@ class Attribute implements \Countable, \ArrayAccess, \Iterator
{
// If we dont have any objectclasses then we cant know if it is required
return $this->oc->count()
? $this->oc->intersect($this->schema->required_by_object_classes->keys())->sort()
? $this->oc->intersect($this->required_by->keys())->sort()
: collect();
}
}