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() } media_refresh_layout.setOnRefreshListener { getMedia() }
try {
mPath = intent.getStringExtra(DIRECTORY) mPath = intent.getStringExtra(DIRECTORY)
} catch (e: Exception) {
showErrorToast(e)
finish()
return
}
storeStateVariables() storeStateVariables()
if (mShowAll) if (mShowAll)
supportActionBar?.setDisplayHomeAsUpEnabled(false) supportActionBar?.setDisplayHomeAsUpEnabled(false)