From 56070cb9c068136ddd8829b68d5462db8fb69a7e Mon Sep 17 00:00:00 2001 From: Lauri Koskimies Date: Fri, 18 Aug 2023 13:51:32 +0300 Subject: [PATCH] Made sure items is an array --- .../src/services/RssXmlParserService/rssXmlParserService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts b/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts index 8f670c081..208b49463 100644 --- a/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts +++ b/samples/react-rss-reader/src/services/RssXmlParserService/rssXmlParserService.ts @@ -161,7 +161,7 @@ export class RssXmlParserService { public static buildRSS2(xmlObj) { let channel:any = Array.isArray(xmlObj.rss.channel) ? xmlObj.rss.channel[0] : xmlObj.rss.channel; - let items = channel.item; + let items = Array.isArray(channel.item) ? channel.item : [channel.item]; let feed = this.buildRSS(channel, items); if (xmlObj.rss.$ && xmlObj.rss.$['xmlns:itunes']) { this.decorateItunes(feed, channel);