leftEpisode and rightEpisodeIntro can be null

This commit is contained in:
Kilian von Pflugk 2024-03-18 21:10:24 +01:00
parent a98525ddaa
commit b8053a3911

View File

@ -785,12 +785,12 @@
// Try to get the timestamps of each intro, falling back a default value of zero if no intro was found // Try to get the timestamps of each intro, falling back a default value of zero if no intro was found
let leftEpisodeIntro = await getJson("Episode/" + selectEpisode1.value + "/IntroTimestamps/v1"); let leftEpisodeIntro = await getJson("Episode/" + selectEpisode1.value + "/IntroTimestamps/v1");
if (!leftEpisodeIntro.hasOwnProperty("IntroStart")) { if (leftEpisodeIntro === null) {
leftEpisodeIntro = { IntroStart: 0, IntroEnd: 0 }; leftEpisodeIntro = { IntroStart: 0, IntroEnd: 0 };
} }
let rightEpisodeIntro = await getJson("Episode/" + selectEpisode2.value + "/IntroTimestamps/v1"); let rightEpisodeIntro = await getJson("Episode/" + selectEpisode2.value + "/IntroTimestamps/v1");
if (!rightEpisodeIntro.hasOwnProperty("IntroStart")) { if (rightEpisodeIntro === null) {
rightEpisodeIntro = { IntroStart: 0, IntroEnd: 0 }; rightEpisodeIntro = { IntroStart: 0, IntroEnd: 0 };
} }