From 8608e06bddd511e1df62be64b484bc297f84d47b Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Tue, 10 Aug 2021 15:33:46 -0700 Subject: [PATCH] fix feed parser links to always be list --- src/link-helper.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/link-helper.js b/src/link-helper.js index 0517dec..5c6b839 100644 --- a/src/link-helper.js +++ b/src/link-helper.js @@ -112,7 +112,11 @@ class LinkHelper { }); feedParser.on('meta', (meta) => { this.logger.debug(_scope, 'FeedParser meta', { meta }); - const feedLinks = meta['atom:link'] || []; + let feedLinks = meta['atom:link'] || []; + if (!Array.isArray(feedLinks)) { + // Parsing RSS seems to return a single entry for this rather than a list. + feedLinks = [feedLinks]; + } feedLinks .map((l) => l['@']) .forEach((l) => { -- 2.45.2