From 291a0373b72a80829904ef81980427ad15ac5cd4 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 26 Jun 2022 15:15:03 +0100 Subject: [PATCH] Fixes for some null-related errors. --- src/components/VideoPlayer.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 0ecca342..318b7eb8 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -80,7 +80,7 @@ export default { }, activated() { this.destroying = false; - this.sponsors?.segments.forEach(segment => (segment.skipped = false)); + this.sponsors?.segments?.forEach(segment => (segment.skipped = false)); this.hotkeysPromise.then(() => { var self = this; this.$hotkeys( @@ -606,7 +606,7 @@ export default { return; } - markers.style.background = `linear-gradient(${array.join(",")})`; + markers?.style.background = `linear-gradient(${array.join(",")})`; }, destroy(hotkeys) { if (this.$ui) { @@ -618,8 +618,8 @@ export default { this.$player.destroy(); this.$player = undefined; } - if (this.$hotkeys && hotkeys) this.$hotkeys.unbind(); - if (this.$refs.container) this.$refs.container.querySelectorAll("div").forEach(node => node.remove()); + if (hotkeys) this.$hotkeys?.unbind(); + this.$refs.container?.querySelectorAll("div").forEach(node => node.remove()); }, }, watch: {