catch exceptions thrown at deleting stored directory paths

This commit is contained in:
tibbi 2019-07-02 15:17:42 +02:00
parent 0dcb96d565
commit be62c4ed9a
1 changed files with 4 additions and 1 deletions

View File

@ -667,7 +667,10 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
fun Context.removeInvalidDBDirectories(dirs: ArrayList<Directory>? = null, directoryDao: DirectoryDao = galleryDB.DirectoryDao()) {
val dirsToCheck = dirs ?: directoryDao.getAll()
dirsToCheck.filter { !it.areFavorites() && !it.isRecycleBin() && !File(it.path).exists() && it.path != config.tempFolderPath }.forEach {
try {
directoryDao.deleteDirPath(it.path)
} catch (ignored: Exception) {
}
}
}