From 0352aa524b3495363d47255785500bec169135df Mon Sep 17 00:00:00 2001 From: Abdallah Mehiz <54363735+abdallahmehiz@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:48:38 +0100 Subject: [PATCH] fix: crash when empty chapters --- .../main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt b/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt index 0453184..fbb7cae 100644 --- a/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt +++ b/app/src/main/java/live/mehiz/mpvkt/ui/player/PlayerActivity.kt @@ -410,7 +410,10 @@ class PlayerActivity : AppCompatActivity() { "time-pos" -> viewModel.updatePlayBackPos(value.toFloat()) "demuxer-cache-time" -> viewModel.updateReadAhead(value = value) "duration" -> viewModel.duration.update { value.toFloat() } - "chapter" -> viewModel.updateChapter(value) + "chapter" -> { + if (value == "-1") return + viewModel.updateChapter(value) + } } }