mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
add a null check
This commit is contained in:
parent
050a700be6
commit
82bd634830
1 changed files with 1 additions and 2 deletions
|
@ -55,7 +55,6 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
|
||||
media_holder.setOnRefreshListener({ getMedia() })
|
||||
mPath = intent.getStringExtra(DIRECTORY)
|
||||
mMedia = ArrayList<Medium>()
|
||||
mShowAll = config.showAll
|
||||
if (mShowAll)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
||||
|
@ -164,7 +163,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
|
||||
private fun deleteDirectoryIfEmpty() {
|
||||
val file = File(mPath)
|
||||
if (file.isDirectory && file.listFiles().isEmpty()) {
|
||||
if (file.isDirectory && file.listFiles()?.isEmpty() == true) {
|
||||
file.delete()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue