Added null-safe operator for components and consumables

This commit is contained in:
snipe
2026-05-07 10:39:57 +01:00
parent 40e89756bf
commit eca34de593
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ class Component extends SnipeModel
*/
public function requireAcceptance()
{
return $this->category->require_acceptance;
return $this->category?->require_acceptance ?? false;
}
/**
+1 -1
View File
@@ -322,7 +322,7 @@ class Consumable extends SnipeModel
*/
public function requireAcceptance()
{
return $this->category->require_acceptance;
return $this->category?->require_acceptance ?? false;
}
/**