diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index f110d95a5..397bb80ee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -54,7 +54,7 @@ fun Context.getParents(isPickImage: Boolean, isPickVideo: Boolean): ArrayList() + parents.mapNotNullTo(notNull, { it }) + filterDirectories(notNull) + return notNull } fun Context.getWhereCondition(isPickImage: Boolean, isPickVideo: Boolean): String { @@ -86,7 +88,7 @@ fun Context.getArgs(isPickImage: Boolean, isPickVideo: Boolean): Array { } } -fun Context.filterDirectories(dirs: MutableList) { +fun Context.filterDirectories(dirs: ArrayList) { if (!config.showHiddenFolders) { removeHiddenFolders(dirs) removeNoMediaFolders(dirs)