diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index bd229721d..4c4daa180 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -455,10 +455,14 @@ class MediaFetcher(val context: Context) { } } - val dateTakenValues = if (folder == FAVORITES) { - context.dateTakensDB.getAllDateTakens() - } else { - context.dateTakensDB.getDateTakensFromPath(folder) + val dateTakenValues = try { + if (folder == FAVORITES) { + context.dateTakensDB.getAllDateTakens() + } else { + context.dateTakensDB.getDateTakensFromPath(folder) + } + } catch (e: Exception) { + return dateTakens } dateTakenValues.forEach {