Skip to content

Commit

Permalink
fix: handle image processing for words without translations
Browse files Browse the repository at this point in the history
  • Loading branch information
troggy committed Jun 6, 2019
1 parent c3e1b37 commit 492bd91
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/js/extractWordData.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const sanitizeString = string => {
}

const wordPicture = word => {
if (!word.translations) return ''
const translationWithPic = word.translations.find(tr => tr.pics && tr.pics.length > 0)
return translationWithPic ? `<img src='http:${translationWithPic.pics[0]}'>` : ''
}
Expand Down

0 comments on commit 492bd91

Please sign in to comment.