Skip to content

Commit

Permalink
Avoid a crash in description when there is no title
Browse files Browse the repository at this point in the history
  • Loading branch information
papoteur-mga authored Jan 13, 2025
1 parent 4f706cd commit 8119bc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Models/Matter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8119bc7

Please sign in to comment.