From edd980fd62418e538a5790448b5a89430205b80e Mon Sep 17 00:00:00 2001 From: Inrixia Date: Mon, 7 Oct 2024 19:14:44 +1300 Subject: [PATCH] lib.MaxTrack - properly handle undefined extTrackItem --- plugins/_lib/MaxTrack.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/_lib/MaxTrack.ts b/plugins/_lib/MaxTrack.ts index 77691fb0..a0e8a993 100644 --- a/plugins/_lib/MaxTrack.ts +++ b/plugins/_lib/MaxTrack.ts @@ -16,10 +16,11 @@ export class MaxTrack { if (maxTrack !== undefined) return maxTrack; const extTrackItem = await ExtendedMediaItem.get(itemId); + if (extTrackItem === undefined) return false; const trackItem = extTrackItem?.tidalTrack; - if (trackItem === undefined || trackItem.contentType !== "track" || this.hasHiRes(trackItem)) return false; + if (trackItem.contentType !== "track" || this.hasHiRes(trackItem)) return false; - const isrcs = await extTrackItem?.isrcs(); + const isrcs = await extTrackItem.isrcs(); if (isrcs === undefined) return (this._maxTrackMap[itemId] = Promise.resolve(false)); return (this._maxTrackMap[itemId] = (async () => {