From 46cdedce0b3155ae5e969b1e246039f90aa06944 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Mon, 23 Sep 2019 00:51:42 +0530 Subject: [PATCH] Fix album details sorting --- .../monkey/retromusic/activities/AlbumDetailsActivity.kt | 2 +- .../monkey/retromusic/activities/ArtistDetailActivity.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt index a81b70d0..d559704d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt @@ -107,7 +107,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView { albumDetailsPresenter.attachView(this) if (intent.extras!!.containsKey(EXTRA_ALBUM_ID)) { - albumDetailsPresenter.loadAlbum(intent.extras!!.getInt(EXTRA_ALBUM_ID)) + intent.extras?.getInt(EXTRA_ALBUM_ID)?.let { albumDetailsPresenter.loadAlbum(it) } } else { finish() } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt index 4e921524..beff5953 100755 --- a/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt @@ -102,7 +102,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView { artistDetailsPresenter.attachView(this) if (intent.extras!!.containsKey(EXTRA_ARTIST_ID)) { - artistDetailsPresenter.loadArtist(intent.extras!!.getInt(EXTRA_ARTIST_ID)) + intent.extras?.getInt(EXTRA_ARTIST_ID)?.let { artistDetailsPresenter.loadArtist(it) } } else { finish() } @@ -327,7 +327,11 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView { } private fun reload() { - artistDetailsPresenter.loadArtist(intent.extras!!.getInt(EXTRA_ARTIST_ID)) + if (intent.extras!!.containsKey(EXTRA_ARTIST_ID)) { + intent.extras?.getInt(EXTRA_ARTIST_ID)?.let { artistDetailsPresenter.loadArtist(it) } + } else { + finish() + } } companion object {