Made sure items is an array

This commit is contained in:
Lauri Koskimies 2023-08-18 13:51:32 +03:00
parent de2aab8f34
commit 56070cb9c0
1 changed files with 1 additions and 1 deletions

View File

@ -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);