From 8119bc7bc0ca54583bf42febcb2165fddb97a831 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Mon, 13 Jan 2025 19:24:34 +0100 Subject: [PATCH] Avoid a crash in description when there is no title --- app/Models/Matter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Models/Matter.php b/app/Models/Matter.php index 78893a09..2493ef0c 100644 --- a/app/Models/Matter.php +++ b/app/Models/Matter.php @@ -529,9 +529,11 @@ public function getDescription($lang = 'en') $granted_date = Carbon::parse($this->grant->event_date); $published_date = Carbon::parse($this->publication->event_date); $title = $this->titles->where('type_code', 'TITOF')->first()->value - ?? $this->titles->first()->value; + ?? $this->titles->first()->value + ?? ""; $title_EN = $this->titles->where('type_code', 'TITEN')->first()->value - ?? $this->titles->first()->value; + ?? $this->titles->first()->value + ?? ""; if ($lang == 'fr') { $description[] = "N/réf : {$this->uid}"; if ($this->client->actor_ref) {