Skip to content

Commit

Permalink
fix(author-scraper): 🐛 don't run author on undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Oct 2, 2021
1 parent 4e3c93c commit c73d8ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/routes/books/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ async function routes (fastify, options) {
if (request.query.seedAuthors !== '0' && newDbItem.authors) {
try {
newDbItem.authors.map((author, index): any => {
return seedAuthors(author!.asin!)
if (author && author.asin) {
return seedAuthors(author.asin)
}
return undefined
})
} catch (err) {
console.error(err)
Expand Down

0 comments on commit c73d8ee

Please sign in to comment.