From be937629c292e6e8eb30446db57d8a8ff5435bdd Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 27 Dec 2024 12:41:22 -0500 Subject: [PATCH] Fix crash in player when video ID is invalid --- CHANGELOG.md | 6 ++++++ playlet-lib/src/components/VideoPlayer/VideoPlayer.bs | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5d4f1fa..88d0c38b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Crash in player when video ID is invalid + ## [0.35.2] - 2024-12-27 ### Fixed diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 63a123d0..61f7acb7 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -266,7 +266,11 @@ function OnVideoContentTaskErrorDialogResponse(event as object) Lounge.SendOnStateChange() end function -function MarkVideoWatched(videoId as string) +function MarkVideoWatched(videoId as dynamic) as void + if StringUtils.IsNullOrEmpty(videoId) + return + end if + if m.top.invidious.authToken <> invalid AsyncTask.Start(Tasks.MarkVideoWatchedTask, { videoId: videoId