From 7daa7cb7c9f5cf37c5985beaef316dd424654fe0 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Mon, 27 May 2024 18:49:26 +0700 Subject: [PATCH] fix: Don't assume download dir is not null --- .../java/eu/kanade/tachiyomi/data/download/DownloadCache.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt index 501243147c..fe5b8707ba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt @@ -126,7 +126,7 @@ class DownloadCache( private fun renew() { val onlineSources = sourceManager.getOnlineSources() - val sourceDirs = storageManager.getDownloadsDirectory()!!.listFiles().orEmpty() + val sourceDirs = storageManager.getDownloadsDirectory()?.listFiles().orEmpty() .associate { it.name to SourceDirectory(it) }.mapNotNullKeys { entry -> onlineSources.find { provider.getSourceDirName(it).equals(entry.key, ignoreCase = true) }?.id }