From f1b29c1d08f825271df4078939ab61ca549e04c3 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 27 Feb 2024 11:30:17 -0500 Subject: [PATCH] Add check for attachment.attachment_url --- src/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.js b/src/parser.js index e1dafa9..683344c 100644 --- a/src/parser.js +++ b/src/parser.js @@ -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],