fix: Check if empty image

Apparently this is allowed, although the OpenAPI specification disallows it.

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
Tim Hårek Andreassen 2024-03-30 15:34:20 +01:00
parent 82c4f8d22f
commit d16829f45e
No known key found for this signature in database
GPG Key ID: E59C7734F0E10EB5
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ function toItemTag(seriesId: string, episode: OriginalEpisode) {
async function buildFeed(seriesId: string) {
const serie = await nrkRadio.getSerieData(seriesId);
const imageUrl = serie.squareImage.at(-1)?.url;
const imageUrl = serie.squareImage?.at(-1)?.url ?? "";
const linkValue = `https://radio.nrk.no/podkast/${serie.id}`;
// Quickly adapted from https://raw.githubusercontent.com/olaven/paperpod/1cde9abd3174b26e126aa74fc5a3b63fd078c0fd/packages/converter/src/rss.ts