catch exceptions thrown at getDeletedMediaCount()
This commit is contained in:
parent
f3eb312e57
commit
45cf8da60f
1 changed files with 10 additions and 7 deletions
|
@ -906,14 +906,17 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
val dateTakens = mLastMediaFetcher!!.getDateTakens()
|
val dateTakens = mLastMediaFetcher!!.getDateTakens()
|
||||||
|
|
||||||
if (config.showRecycleBinAtFolders && !config.showRecycleBinLast && !dirs.map { it.path }.contains(RECYCLE_BIN)) {
|
if (config.showRecycleBinAtFolders && !config.showRecycleBinLast && !dirs.map { it.path }.contains(RECYCLE_BIN)) {
|
||||||
if (mediaDB.getDeletedMediaCount() > 0) {
|
try {
|
||||||
val recycleBin = Directory().apply {
|
if (mediaDB.getDeletedMediaCount() > 0) {
|
||||||
path = RECYCLE_BIN
|
val recycleBin = Directory().apply {
|
||||||
name = getString(R.string.recycle_bin)
|
path = RECYCLE_BIN
|
||||||
location = LOCATION_INTERNAL
|
name = getString(R.string.recycle_bin)
|
||||||
}
|
location = LOCATION_INTERNAL
|
||||||
|
}
|
||||||
|
|
||||||
dirs.add(0, recycleBin)
|
dirs.add(0, recycleBin)
|
||||||
|
}
|
||||||
|
} catch (ignored: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue