From 6976c35ee481a6ed728322c818db15fa0175973b Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Feb 2018 18:40:25 +0100 Subject: [PATCH] make sure the directory thumbnail file exists --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index a7165c1c9..2050d4798 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -38,7 +38,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val firstItem = curMedia.first() val lastItem = curMedia.last() val parentDir = if (hasOTG && firstItem.path.startsWith(OTG_PATH)) firstItem.path.getParentPath() else File(firstItem.path).parent - var thumbnail = firstItem.path + var thumbnail = curMedia.firstOrNull { context.getDoesFilePathExist(it.path) }?.path ?: "" if (thumbnail.startsWith(OTG_PATH)) { thumbnail = thumbnail.getOTGPublicPath(context) }