From 665f76701d2212cb2f2782c5c70294cdbadd7a1f Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 8 Dec 2023 06:40:05 -0500 Subject: [PATCH] Small bug fix --- CHANGELOG.md | 4 ++++ playlet-lib/src/components/VideoPlayer/VideoPlayer.bs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6decc4cb..98a7865b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - An instance test to make sure thumbnails are reachable +### Fixed + +- A rare error when video player is closed but does not have valid content + ## [0.17.0] - 2023-11-17 ### Added diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 7e66cedc..fc124dc4 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -188,12 +188,14 @@ function OnVideoPlayerStateChange() as void if content = invalid m.container@.watchedVideosClear(invalid) VideoUtils.CloseVideo() + return end if metadata = content.metadata if metadata = invalid m.container@.watchedVideosClear(invalid) VideoUtils.CloseVideo() + return end if if not PlayNext(metadata.recommendedVideos)