adding a null check at checking invalid folders

This commit is contained in:
tibbi 2020-03-01 22:38:57 +01:00
parent 76788fc093
commit 9c31b8d01e
1 changed files with 1 additions and 1 deletions

View File

@ -1155,7 +1155,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
} else if (it.path != config.tempFolderPath) {
val children = if (isPathOnOTG(it.path)) getOTGFolderChildrenNames(it.path) else File(it.path).list()?.asList()
val hasMediaFile = children?.any {
it?.isMediaFile() == true || (File(it!!).isDirectory && it.startsWith("img_", true))
it != null && (it.isMediaFile() || (File(it).isDirectory && it.startsWith("img_", true)))
} ?: false
if (!hasMediaFile) {