Skip to content

Commit

Permalink
fix(ChannelAboutFullMetadata): fix error when there are no primary li…
Browse files Browse the repository at this point in the history
…nks (#299)
  • Loading branch information
absidue authored Jan 30, 2023
1 parent de61782 commit f62c66d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser/classes/ChannelAboutFullMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f62c66d

Please sign in to comment.