diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 61ea88362..3b4ed44d1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -70,7 +70,9 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } private fun shouldFolderBeVisible(path: String, excludedPaths: MutableSet): Boolean { - return isThisOrParentExcluded(path, excludedPaths) || (!config.shouldShowHidden && File(path).containsNoMedia()) + val file = File(path) + return isThisOrParentExcluded(path, excludedPaths) || (!config.shouldShowHidden && file.isDirectory && + file.canonicalFile == file.absoluteFile && file.containsNoMedia()) } private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet) = excludedPaths.any { path.startsWith(it) }