From 4f3de9a9ad1d792e560f97ef940cb19da21ba824 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 6 May 2020 18:37:46 +0200 Subject: [PATCH] adding a crashfix at actionmenu item checking --- .../com/simplemobiletools/musicplayer/adapters/SongAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/SongAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/SongAdapter.kt index 93ef6f02..d2f56256 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/SongAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/adapters/SongAdapter.kt @@ -93,7 +93,7 @@ class SongAdapter(activity: SimpleActivity, var songs: ArrayList, val list override fun prepareActionMode(menu: Menu) { menu.apply { - findItem(R.id.cab_rename).isVisible = isOneItemSelected() && !getSelectedSongs().first().path.startsWith("content://") + findItem(R.id.cab_rename).isVisible = isOneItemSelected() && getSelectedSongs().firstOrNull()?.path?.startsWith("content://") != true } }