Skip to content

Commit

Permalink
fix: crash when empty chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Aug 26, 2024
1 parent 81b490d commit ebac569
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class PlayerViewModel(
}

fun updateChapter(index: Long) {
if (chapters.isEmpty()) return
if (chapters.isEmpty() || index == -1L) return
_currentChapter.update { chapters[index.toInt()] }
}

Expand Down

0 comments on commit ebac569

Please sign in to comment.