home: fix crash on music updates
This commit is contained in:
@@ -95,7 +95,7 @@ class AlbumListFragment :
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val album = homeModel.albumList.value[pos]
|
||||
val album = homeModel.albumList.value.getOrNull(pos) ?: return null
|
||||
// Change how we display the popup depending on the current sort mode.
|
||||
return when (homeModel.albumSort.mode) {
|
||||
// By Name -> Use Name
|
||||
|
||||
@@ -90,7 +90,7 @@ class ArtistListFragment :
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val artist = homeModel.artistList.value[pos]
|
||||
val artist = homeModel.artistList.value.getOrNull(pos) ?: return null
|
||||
// Change how we display the popup depending on the current sort mode.
|
||||
return when (homeModel.artistSort.mode) {
|
||||
// By Name -> Use Name
|
||||
|
||||
@@ -89,7 +89,7 @@ class GenreListFragment :
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val genre = homeModel.genreList.value[pos]
|
||||
val genre = homeModel.genreList.value.getOrNull(pos) ?: return null
|
||||
// Change how we display the popup depending on the current sort mode.
|
||||
return when (homeModel.genreSort.mode) {
|
||||
// By Name -> Use Name
|
||||
|
||||
@@ -87,7 +87,7 @@ class PlaylistListFragment :
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val playlist = homeModel.playlistList.value[pos]
|
||||
val playlist = homeModel.playlistList.value.getOrNull(pos) ?: return null
|
||||
// Change how we display the popup depending on the current sort mode.
|
||||
return when (homeModel.playlistSort.mode) {
|
||||
// By Name -> Use Name
|
||||
|
||||
@@ -92,7 +92,7 @@ class SongListFragment :
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val song = homeModel.songList.value[pos]
|
||||
val song = homeModel.songList.value.getOrNull(pos) ?: return null
|
||||
// Change how we display the popup depending on the current sort mode.
|
||||
// Note: We don't use the more correct individual artist name here, as sorts are largely
|
||||
// based off the names of the parent objects and not the child objects.
|
||||
|
||||
Reference in New Issue
Block a user