From 47a4bc708667954a68ffa2480f1d4962f5feb37f Mon Sep 17 00:00:00 2001 From: Igor Nazarov Date: Wed, 4 Sep 2024 18:04:11 +0400 Subject: [PATCH] Fixed split call on undefined issue with loading guests name and title from transistor service. --- src/utils/transistor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/transistor.ts b/src/utils/transistor.ts index 51af175..450cebf 100644 --- a/src/utils/transistor.ts +++ b/src/utils/transistor.ts @@ -5,7 +5,7 @@ export const parseEpisodeTitle = ( guest: { name?: string; title?: string }; } => { const [title, guest] = str.split(' - '); - const [guestName, guestTitle] = guest.split(', '); + const [guestName = '', guestTitle = ''] = guest?.split(', ') || []; return { title,