From d885f301cbfc1330f9157edbf6caa940546579d9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 16 Mar 2017 19:21:50 +0100 Subject: [PATCH] filter out symbolic links as directories --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 790214824..a58a9cf34 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -61,7 +61,10 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va media.sort() val directories = groupDirectories(media) - val dirs = ArrayList(directories.values.filter { File(it.path).exists() }) + val dirs = ArrayList(directories.values.filter { + val file = File(it.path) + file.exists() && file.canonicalFile == file.absoluteFile // filter out symbolic links too + }) Directory.sorting = config.directorySorting dirs.sort()