From 657b14fdb40b07f14d8c0cff6fa24c368a2667d7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Nov 2016 15:29:54 +0100 Subject: [PATCH] add a null check at obtaining files to fix some crashes --- .../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 318f98c91..b869deb6a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -45,7 +45,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va if (cursor != null && cursor.moveToFirst()) { val pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA) do { - val fullPath = cursor.getString(pathIndex) + val fullPath: String = cursor.getString(pathIndex) ?: continue val file = File(fullPath) val parentDir = file.parent