Skip to content

Commit

Permalink
minor edge case bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Blakeinstein committed Nov 2, 2020
1 parent c4018cf commit 212b964
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/eventCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ function EventCard(props) {
const { title, description, attachments, link } = props
const startDate = moment(props.startDate)
const endDate = moment(props.endDate)

const imageAttachment = attachments.find(a => a.mimeType.startsWith("image/"))
let imageAttachment = null;
if (attachments)
imageAttachment = attachments.find(a => a.mimeType.startsWith("image/")) || null;
let imageUrl = imageAttachment
? "https://drive.google.com/uc?export=view&id=" + imageAttachment.fileId
: "https://drive.google.com/uc?export=view&id=1FQCwCAFxeagUXASyYQEIFljeQ-dTqiOU"
Expand Down

0 comments on commit 212b964

Please sign in to comment.