Fix the warning 'ID must not be null'

This commit is contained in:
tzugen 2023-05-09 11:48:08 +02:00
parent 2c3f43f139
commit 0e2171b872
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930

View File

@ -574,14 +574,14 @@ open class TrackCollectionFragment(
} else if (getVideos) {
setTitle(R.string.main_videos)
listModel.getVideos(refresh2)
} else if (getRandomTracks) {
} else if (id == null || getRandomTracks) {
// There seems to be a bug in ViewPager when resuming the Actitivy that subfragments
// arguments are empty. If we have no id, just show some random tracks
setTitle(R.string.main_songs_random)
listModel.getRandom(size, append)
} else {
setTitle(name)
requireNotNull(id) {
"ID must be set. NavArgs: ${navArgs.toBundle()}"
}
if (ActiveServerProvider.isID3Enabled()) {
if (isAlbum) {
listModel.getAlbum(refresh2, id, name)