diff --git a/public/modules/custom/paatokset_policymakers/src/Controller/PolicymakerController.php b/public/modules/custom/paatokset_policymakers/src/Controller/PolicymakerController.php index c34e552f4..bdfd48464 100644 --- a/public/modules/custom/paatokset_policymakers/src/Controller/PolicymakerController.php +++ b/public/modules/custom/paatokset_policymakers/src/Controller/PolicymakerController.php @@ -176,8 +176,11 @@ public static function getDecisionsTitle(): TranslatableMarkup { * Render array. */ public function discussionMinutes(): array { - $build = ['#title' => $this->t('Discussion minutes: @title', ['@title' => $this->policymakerService->getPolicymaker()->get('title')->value])]; - return $build; + $policymaker = $this->policymakerService->getPolicymaker(); + if (!$policymaker) { + return ['#title' => $this->t('Discussion minutes:')]; + } + return ['#title' => $this->t('Discussion minutes: @title', ['@title' => $policymaker->get('title')->value])]; } /**