From 3f953def16a7512faef25ee30dfc0ddf9c3cdcec Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sun, 29 Jan 2023 22:38:23 +0100 Subject: [PATCH] fix(ChannelAboutFullMetadata) Fix error when there are no primary links --- src/parser/classes/ChannelAboutFullMetadata.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/classes/ChannelAboutFullMetadata.ts b/src/parser/classes/ChannelAboutFullMetadata.ts index d74b8648c..c40bbaed5 100644 --- a/src/parser/classes/ChannelAboutFullMetadata.ts +++ b/src/parser/classes/ChannelAboutFullMetadata.ts @@ -37,11 +37,11 @@ class ChannelAboutFullMetadata extends YTNode { this.avatar = Thumbnail.fromResponse(data.avatar); this.canonical_channel_url = data.canonicalChannelUrl; - this.primary_links = data.primaryLinks.map((link: any) => ({ + this.primary_links = data.primaryLinks?.map((link: any) => ({ endpoint: new NavigationEndpoint(link.navigationEndpoint), icon: Thumbnail.fromResponse(link.icon), title: new Text(link.title) - })); + })) ?? []; this.views = new Text(data.viewCountText); this.joined = new Text(data.joinedDateText);