From 2ed6a0aedc2d2f6b1ac2fd9a1ac137772831f713 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 9 Oct 2017 11:25:41 +0200 Subject: [PATCH 1/1] Fix exception when getting 404 in video watch --- .../src/app/videos/video-watch/video-watch.component.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index dbe391fff..db3e1cdd6 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -66,11 +66,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } ngOnDestroy () { - // Remove WebTorrent stuff - console.log('Removing video from webtorrent.') - - // Remove player - videojs(this.playerElement).dispose() + // Remove player if it exists + if (this.videoNotFound === false) { + videojs(this.playerElement).dispose() + } // Unsubscribe subscriptions this.paramsSub.unsubscribe() -- 2.41.0