Skip to content

Commit

Permalink
Merge pull request #113 from lonekorean/fix-bad-attachment
Browse files Browse the repository at this point in the history
Add check for attachment.attachment_url
  • Loading branch information
lonekorean authored Feb 27, 2024
2 parents 6ca1f69 + f1b29c1 commit b5f0fd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function getPostCoverImageId(postData) {
function collectAttachedImages(channelData) {
const images = getItemsOfType(channelData, 'attachment')
// filter to certain image file types
.filter(attachment => (/\.(gif|jpe?g|png)$/i).test(attachment.attachment_url[0]))
.filter(attachment => attachment.attachment_url && (/\.(gif|jpe?g|png)$/i).test(attachment.attachment_url[0]))
.map(attachment => ({
id: attachment.post_id[0],
postId: attachment.post_parent[0],
Expand Down

0 comments on commit b5f0fd7

Please sign in to comment.