From c14ad8fb146472d8a1abaedff6dc61dc5c661f37 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Wed, 8 Nov 2023 08:31:34 +0200 Subject: [PATCH] UHF-9024: Add stricter error checking --- .../paatokset_policymakers/src/Service/PolicymakerService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/modules/custom/paatokset_policymakers/src/Service/PolicymakerService.php b/public/modules/custom/paatokset_policymakers/src/Service/PolicymakerService.php index fa73cb3ab..a532ea500 100644 --- a/public/modules/custom/paatokset_policymakers/src/Service/PolicymakerService.php +++ b/public/modules/custom/paatokset_policymakers/src/Service/PolicymakerService.php @@ -20,6 +20,7 @@ use Drupal\paatokset_policymakers\Enum\PolicymakerRoutes; use Drupal\path_alias\AliasManagerInterface; use Drupal\search_api\Entity\Index; +use InvalidArgumentException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -1491,7 +1492,7 @@ public function getMeetingTitle(NodeInterface $meeting): string { */ public function getMeetingAgenda(string $meetingId): ?array { if (!$this->policymaker instanceof NodeInterface || !$this->policymakerId) { - return []; + throw new InvalidArgumentException("Missing policymaker"); } $meeting = $this->getMeetingNode($meetingId);