Skip to content

Commit

Permalink
Fix library settings sheet causing app to crash...
Browse files Browse the repository at this point in the history
...when the category list is empty
  • Loading branch information
jmir1 committed Jun 8, 2021
1 parent 31d96c2 commit e26b8d8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ class LibraryController(
}

fun showSettingsSheet() {
adapter?.categories?.get(binding.libraryPager.currentItem)?.let { category ->
settingsSheet?.show(category)
if (adapter?.categories?.isNotEmpty() == true) {
adapter?.categories?.get(binding.libraryPager.currentItem)?.let { category ->
settingsSheet?.show(category)
}
} else {
settingsSheet?.show()
}
}

Expand Down

0 comments on commit e26b8d8

Please sign in to comment.