mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-16 20:10:37 +01:00
adding a null check at checking invalid folders
This commit is contained in:
parent
76788fc093
commit
9c31b8d01e
@ -1155,7 +1155,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||||||
} else if (it.path != config.tempFolderPath) {
|
} else if (it.path != config.tempFolderPath) {
|
||||||
val children = if (isPathOnOTG(it.path)) getOTGFolderChildrenNames(it.path) else File(it.path).list()?.asList()
|
val children = if (isPathOnOTG(it.path)) getOTGFolderChildrenNames(it.path) else File(it.path).list()?.asList()
|
||||||
val hasMediaFile = children?.any {
|
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
|
} ?: false
|
||||||
|
|
||||||
if (!hasMediaFile) {
|
if (!hasMediaFile) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user