From 7e218d10500a1dfb10133c75d85006e48061fa62 Mon Sep 17 00:00:00 2001
From: Christian Bager Bach Houmann <christian@bagerbach.com>
Date: Tue, 15 Nov 2022 09:31:35 +0100
Subject: [PATCH] fix: allow episodes with no description

fixes #46 by allowing podcasts with no description

fix #46
---
 src/parser/feedParser.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/parser/feedParser.ts b/src/parser/feedParser.ts
index f6cea29..5acb920 100644
--- a/src/parser/feedParser.ts
+++ b/src/parser/feedParser.ts
@@ -85,7 +85,7 @@ export default class FeedParser {
 		const pubDateEl = item.querySelector("pubDate");
 		const itunesImageEl = item.querySelector("image");
 
-		if (!titleEl || !streamUrlEl || !descriptionEl || !pubDateEl) {
+		if (!titleEl || !streamUrlEl || !pubDateEl) {
 			console.log(titleEl, streamUrlEl, linkEl, descriptionEl, pubDateEl);
 			throw new Error("Invalid RSS feed");
 		}
@@ -93,7 +93,7 @@ export default class FeedParser {
 		const title = titleEl.textContent || "";
 		const streamUrl = streamUrlEl.getAttribute("url") || "";
 		const url = linkEl?.textContent || "";
-		const description = descriptionEl.textContent || "";
+		const description = descriptionEl?.textContent || "";
 		const pubDate = new Date(pubDateEl.textContent as string);
 		const artworkUrl = itunesImageEl?.getAttribute("href") || this.feed?.artworkUrl;
 
-- 
GitLab