Skip to content

Commit

Permalink
fix(parser): The AvatarView.image_processor property is optional (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Nov 18, 2024
1 parent 680da9f commit 4b178e4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/parser/classes/AvatarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};
}
}
}

0 comments on commit 4b178e4

Please sign in to comment.