diff --git a/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt b/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt index 3f67ea61..58f9b65e 100644 --- a/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt +++ b/src/main/java/org/havenapp/main/service/RemoveDeletedFilesJob.kt @@ -110,7 +110,7 @@ class RemoveDeletedFilesJob: Job() { if (!storageDir.exists() || !storageDir.isDirectory) return - currentFileList.addAll(storageDir.listFiles()) + storageDir.listFiles() ?: currentFileList.addAll(storageDir.listFiles()) val subDir = storageDir.list { dir, name -> File(dir, name).isDirectory } subDir.filter { it != null }.forEach { getAllFileInStorageDir(File(storageDir, it), currentFileList) }