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 {