From: Chocobozzz Date: Mon, 9 Oct 2017 09:25:41 +0000 (+0200) Subject: Fix exception when getting 404 in video watch X-Git-Tag: v0.0.1-alpha~309 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2ed6a0aedc2d2f6b1ac2fd9a1ac137772831f713;p=oweals%2Fpeertube.git Fix exception when getting 404 in video watch --- 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()