catch and show exceptions thrown at fetching path of MediaActivity

This commit is contained in:
tibbi 2018-02-04 18:02:06 +01:00
parent 0a752cea03
commit 8effeedd7d

View file

@ -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)