Skip to content

Commit

Permalink
Add files only if listFiles is non null
Browse files Browse the repository at this point in the history
Signed-off-by: Arka Prava Basu <[email protected]>
  • Loading branch information
archie94 committed Nov 9, 2018
1 parent fafdba0 commit b11c3d0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit b11c3d0

Please sign in to comment.