diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 29b64841d..97becbd1c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -81,7 +81,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } media_refresh_layout.setOnRefreshListener { getMedia() } - mPath = intent.getStringExtra(DIRECTORY) + try { + mPath = intent.getStringExtra(DIRECTORY) + } catch (e: Exception) { + showErrorToast(e) + finish() + return + } + storeStateVariables() if (mShowAll) supportActionBar?.setDisplayHomeAsUpEnabled(false)