minor fix

This commit is contained in:
Thibault Deckers 2024-04-25 01:17:11 +02:00
parent a3dcf41786
commit fc9d282caa

View file

@ -134,7 +134,7 @@ class StorageHandler(private val context: Context) : MethodCallHandler {
return
}
val trashDirs = context.getExternalFilesDirs(null).mapNotNull { StorageUtils.trashDirFor(context, it.path) }
val trashDirs = context.getExternalFilesDirs(null).filterNotNull().mapNotNull { StorageUtils.trashDirFor(context, it.path) }
val trashItemPaths = trashDirs.flatMap { dir -> dir.listFiles()?.filterNotNull()?.mapNotNull { file -> file.path } ?: listOf() }
val untrackedPaths = trashItemPaths.filterNot(knownPaths::contains).toList()