add some null checks to data folder getter

This commit is contained in:
tibbi 2017-04-03 18:20:24 +02:00
parent a02744ebac
commit 8545ab8430
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ class Config(context: Context) : BaseConfig(context) {
private fun getDataFolder(): Set<String> { private fun getDataFolder(): Set<String> {
val folders = HashSet<String>() val folders = HashSet<String>()
val dataFolder = context.externalCacheDir.parentFile.parent.trimEnd('/') val dataFolder = context.externalCacheDir?.parentFile?.parent?.trimEnd('/') ?: ""
if (dataFolder.endsWith("data")) if (dataFolder.endsWith("data"))
folders.add(dataFolder) folders.add(dataFolder)
return folders return folders