From 31079ddef0f73b3e635395ef94432e5783704c3c Mon Sep 17 00:00:00 2001 From: patrickkfkan Date: Thu, 21 Jan 2021 02:01:45 +0800 Subject: [PATCH] parseAlbumInfo(): handle missing properties --- lib/parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index 43ebd27..f4c708b 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -161,7 +161,7 @@ function parseAlbumInfo(html, opts) { name: release.name, url: release.url, format: release.musicReleaseFormat, - description: release.description, + description: release.description || '', imageUrl: utils.reformatImageUrl(release.image, opts.albumImageFormat) }); }); @@ -172,7 +172,7 @@ function parseAlbumInfo(html, opts) { if (Array.isArray(extra.trackinfo)) { extra.trackinfo.every( track => { if (url.endsWith(track.title_link)) { - file = track.file['mp3-128']; + file = track.file && track.file['mp3-128'] ? track.file['mp3-128'] : null; return false; } return true;