Handle null owner cases in accounting entity

This commit is contained in:
2024-12-10 16:03:26 +01:00
parent dfcd35aafc
commit abc1bc6354
+7 -1
View File
@@ -91,10 +91,16 @@ class Accounting
case Tipjar::class:
return $this->getTipjar();
}
return null;
}
public function setOwner(AccountingOwnerInterface $owner): static
public function setOwner(?AccountingOwnerInterface $owner): static
{
if ($owner === null) {
return $this;
}
$this->setOwnerClass($owner::class);
switch ($this->getOwnerClass()) {