Skip to content

Commit

Permalink
fix media
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Apr 16, 2019
1 parent 27de911 commit 4570250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/researchHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Handlers {
// console.log(JSON.stringify(obj.items.item, null, 2))

if (!image && obj.items.item.media) {
const medias = obj.items.item.media.medium
const medias = obj.items.item.media.medium || obj.items.item.media

if (Array.isArray(medias)) {
medias.forEach((media) => {
Expand All @@ -126,7 +126,7 @@ class Handlers {
image = media.url._text
}
})
} else if (medias && medias.url) {
} else if (medias.url) {
image = medias.url._text
}
}
Expand Down

0 comments on commit 4570250

Please sign in to comment.