fix: Music#Artistparse err if missing shelves (#155)

This commit is contained in:
Patrick Kan
2022-08-29 02:50:00 +08:00
committed by GitHub
parent 13a86cb4e7
commit 173aec65f5

View File

@@ -20,8 +20,8 @@ class Artist {
this.header = this.page.header.item().as(MusicImmersiveHeader);
const music_shelf = this.#page.contents_memo.get('MusicShelf') as MusicShelf[];
const music_carousel_shelf = this.#page.contents_memo.get('MusicCarouselShelf') as MusicCarouselShelf[];
const music_shelf = this.#page.contents_memo.get('MusicShelf') as MusicShelf[] || [];
const music_carousel_shelf = this.#page.contents_memo.get('MusicCarouselShelf') as MusicCarouselShelf[] || [];
this.sections = [ ...music_shelf, ...music_carousel_shelf ];
}