Skip to content

Commit

Permalink
Bug Fix: Fix no files deleted from disk on successful job run
Browse files Browse the repository at this point in the history
- the null check was wrongly implemented

Signed-off-by: Arka Prava Basu <[email protected]>
  • Loading branch information
archie94 committed Feb 20, 2019
1 parent 860338f commit d7b725e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class RemoveDeletedFilesJob: Job() {
if (!storageDir.exists() || !storageDir.isDirectory)
return

storageDir.listFiles() ?: currentFileList.addAll(storageDir.listFiles())
storageDir.listFiles()?.let {
currentFileList.addAll(it)
}

val subDir = storageDir.list { dir, name -> File(dir, name).isDirectory }
subDir.filter { it != null }.forEach { getAllFileInStorageDir(File(storageDir, it), currentFileList) }
Expand Down

0 comments on commit d7b725e

Please sign in to comment.