From b3fc3d1890d8f8666a834bfd7ef6df7ce8583c5c Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Mon, 22 Apr 2024 21:46:05 +0200 Subject: [PATCH] Fix: Site title when bundle has no section --- app/Classes/Bundle.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Classes/Bundle.php b/app/Classes/Bundle.php index f649c82..73373a2 100644 --- a/app/Classes/Bundle.php +++ b/app/Classes/Bundle.php @@ -123,7 +123,14 @@ public function getArticleTitle(): string public function getSiteTitle(): string { - return $this->getArticleTitle() . ' - ' . $this->getSection()->getArticleTitle(); + $title = $this->getArticleTitle(); + $section = $this->getSection(); + + if (!empty($section)) { + $title .= ' - ' . $section->getArticleTitle(); + } + + return $title; } public function render()