From 28ccfb6fe1f49e240345579633b3a12a442bd2e1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 11 Sep 2017 21:34:23 +0200 Subject: [PATCH] add a file.exists() check too --- .../kotlin/com/simplemobiletools/gallery/extensions/context.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index 3d0d115b6..8a0613a58 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -139,6 +139,9 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP } if (!isExcluded || isThirdPartyIntent) { + if (!file.exists()) + continue + val dateTaken = cur.getLongValue(MediaStore.Images.Media.DATE_TAKEN) val dateModified = cur.getIntValue(MediaStore.Images.Media.DATE_MODIFIED) * 1000L