From 4b178e4bfbc4cb003ed098afcd0370f98dbf834b Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:54:03 +0100 Subject: [PATCH] fix(parser): The AvatarView.image_processor property is optional (#807) --- src/parser/classes/AvatarView.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/parser/classes/AvatarView.ts b/src/parser/classes/AvatarView.ts index 6ef8b1eaf..f5709b90f 100644 --- a/src/parser/classes/AvatarView.ts +++ b/src/parser/classes/AvatarView.ts @@ -10,17 +10,20 @@ export default class AvatarView extends YTNode { border_image_processor: { circular: boolean } - }; + } | undefined; avatar_image_size: string; constructor(data: RawNode) { super(); this.image = Thumbnail.fromResponse(data.image); - this.image_processor = { - border_image_processor: { - circular: data.image.processor.borderImageProcessor.circular - } - }; this.avatar_image_size = data.avatarImageSize; + + if (data.image.processor) { + this.image_processor = { + border_image_processor: { + circular: data.image.processor.borderImageProcessor.circular + } + }; + } } } \ No newline at end of file