add a null check to folder deletion

This commit is contained in:
tibbi 2017-03-12 20:26:17 +01:00
parent 455bae1638
commit 7fd20f6987

View file

@ -114,7 +114,7 @@ fun BaseSimpleActivity.deleteFolderBg(folder: File, deleteMediaOnly: Boolean = t
deleteFileBg(file, false) { }
}
if (folder.listFiles().isEmpty()) {
if (folder.listFiles()?.isEmpty() == true) {
deleteFileBg(folder, true) { }
}
}