From 15285e8c2ca9d2310d6112a1f6ed461693ead0bf Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Dec 2020 23:27:49 +0100 Subject: [PATCH] fixing a crash at fetching Date Taken values from our db --- .../gallery/pro/helpers/MediaFetcher.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 {