Skip to content

Commit

Permalink
Refs #267520 - Fix error when img is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
GhitaB committed Mar 25, 2024
1 parent 5a62787 commit 588c3dd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/theme/Views/NewsItemView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ function NewsItemView(props) {
<p className="documentDescription eea callout">
{content.description}
</p>
<div className="lead-img">
<img
className="main-img"
src={content.image.download}
alt={content.title}
/>
<p className="main-img-caption">{content.image_caption}</p>
</div>
{!!content.image && (
<div className="lead-img">
<img
className="main-img"
src={content.image?.download}
alt={content.title}
/>
<p className="main-img-caption">{content.image_caption}</p>
</div>
)}
<HTMLField value={content.text} />
</>
)}
Expand Down

0 comments on commit 588c3dd

Please sign in to comment.