diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index a6fec1db6..a0a4e3984 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -759,6 +759,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { dirs.forEach { if (!getDoesFilePathExist(it.path)) { invalidDirs.add(it) + } else { + val children = File(it.path).list() + val hasMediaFile = children?.any { it.isImageVideoGif() } ?: false + if (!hasMediaFile) { + invalidDirs.add(it) + } } }