From 822ce063d0bce029e577ece8ca64c452c55ad9d5 Mon Sep 17 00:00:00 2001 From: Andrew Newton Date: Mon, 23 Sep 2024 14:30:42 +0100 Subject: [PATCH] fix: Check records are actually related to an Operating Centre before accesing that property. (#347) --- app/api/module/Api/src/Entity/Licence/Licence.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/module/Api/src/Entity/Licence/Licence.php b/app/api/module/Api/src/Entity/Licence/Licence.php index 0499ec5538..2155e15da0 100644 --- a/app/api/module/Api/src/Entity/Licence/Licence.php +++ b/app/api/module/Api/src/Entity/Licence/Licence.php @@ -570,7 +570,7 @@ public function getGroupedConditionsUndertakings() 'notes' => $cu->getNotes(), 'createdOn' => $cu->getCreatedOn(true) ]; - } else { + } elseif ($cu->getOperatingCentre() !== null && $cu->getOperatingCentre()->getId() !== null) { $ocConditionsUndertakings[$cu->getOperatingCentre()->getId()][$conditionType][] = [ 'notes' => $cu->getNotes(), 'address' => [