mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
add a null check
This commit is contained in:
@@ -55,7 +55,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||||||
|
|
||||||
media_holder.setOnRefreshListener({ getMedia() })
|
media_holder.setOnRefreshListener({ getMedia() })
|
||||||
mPath = intent.getStringExtra(DIRECTORY)
|
mPath = intent.getStringExtra(DIRECTORY)
|
||||||
mMedia = ArrayList<Medium>()
|
|
||||||
mShowAll = config.showAll
|
mShowAll = config.showAll
|
||||||
if (mShowAll)
|
if (mShowAll)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
||||||
@@ -164,7 +163,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||||||
|
|
||||||
private fun deleteDirectoryIfEmpty() {
|
private fun deleteDirectoryIfEmpty() {
|
||||||
val file = File(mPath)
|
val file = File(mPath)
|
||||||
if (file.isDirectory && file.listFiles().isEmpty()) {
|
if (file.isDirectory && file.listFiles()?.isEmpty() == true) {
|
||||||
file.delete()
|
file.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user