Skip to content

Commit

Permalink
Merge pull request #801 from UN-OCHA/berliner/errors
Browse files Browse the repository at this point in the history
Prevent errors when hero image is missing
  • Loading branch information
berliner authored Nov 15, 2023
2 parents 7e5d10f + 05cfda2 commit c2c4e01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions html/modules/custom/ghi_hero_image/src/HeroImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ public function getImageProperties(FieldItemListInterface $items, FormatterInter
break;
}

return [
return $image_url && $file_uri ? [
'image_url' => $image_url,
'file_uri' => $file_uri,
'caption' => $caption,
'credit' => $credit,
];
] : NULL;
}

/**
Expand Down

0 comments on commit c2c4e01

Please sign in to comment.