Skip to content
Snippets Groups Projects
Commit 98fd9572 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix crash when initializing with an empty chapter list

parent de3073c6
No related branches found
No related tags found
1 merge request!94Fix crash when initializing with an empty chapter list
Pipeline #6675 passed with stage
in 4 minutes and 30 seconds
......@@ -309,6 +309,7 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
private fun initChapters(binding: PlayerOptionItemBinding) {
val chapters = service.getChapters(-1) ?: return
if (chapters.isEmpty()) return
val index = service.chapterIdx
if (chapters[index].name.isNullOrEmpty())
binding.optionTitle.text = String.format("%s %d", res.getString(R.string.chapter), index)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment