diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt index b23b28522..312235ba9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt @@ -453,6 +453,14 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasResc } } + if (!didUpdateFile) { + toast(R.string.no_date_takens_found) + runOnUiThread { + callback?.invoke() + } + return@ensureBackgroundThread + } + val resultSize = contentResolver.applyBatch(MediaStore.AUTHORITY, operations).size if (resultSize == 0) { didUpdateFile = false diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 8fe4f8b67..5834cf4fd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -958,7 +958,7 @@ fun Context.getFileDateTaken(path: String): Long { do { try { return cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) - } catch (e: Exception) { + } catch (ignored: Exception) { } } while (cursor.moveToNext()) }