From 8545ab8430e202cf1b61d3a8ed36d519ce8555b9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 3 Apr 2017 18:20:24 +0200 Subject: [PATCH] add some null checks to data folder getter --- .../main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 15fb9d960..71392866b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -92,7 +92,7 @@ class Config(context: Context) : BaseConfig(context) { private fun getDataFolder(): Set { val folders = HashSet() - val dataFolder = context.externalCacheDir.parentFile.parent.trimEnd('/') + val dataFolder = context.externalCacheDir?.parentFile?.parent?.trimEnd('/') ?: "" if (dataFolder.endsWith("data")) folders.add(dataFolder) return folders