Skip to content

Commit c8bee5b

Browse files
committed
show images only if exists
1 parent 2b910fe commit c8bee5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/templates/posts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Posts = props => {
2121
{posts.nodes.map(post => (
2222
<div>
2323
<Link to={post.slug}>
24-
<img src={post.featuredImage.link} alt={post.title} />
24+
{post.featuredImage && <img src={post.featuredImage.link} alt={post.title} /> }
2525
<h2 className="text-2xl mb-6" key={post.id}>
2626
{post.title}
2727
</h2>

0 commit comments

Comments
 (0)