Skip to content

Commit ef91621

Browse files
committed
avoid showing invalid files at Recents
1 parent 2150ad1 commit ef91621

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.provider.MediaStore
55
import android.util.AttributeSet
66
import androidx.recyclerview.widget.GridLayoutManager
77
import com.simplemobiletools.commons.extensions.beVisibleIf
8+
import com.simplemobiletools.commons.extensions.getDoesFilePathExist
89
import com.simplemobiletools.commons.extensions.getLongValue
910
import com.simplemobiletools.commons.extensions.getStringValue
1011
import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID
@@ -125,7 +126,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
125126
val size = cursor.getLongValue(MediaStore.Files.FileColumns.SIZE)
126127
val modified = cursor.getLongValue(MediaStore.Files.FileColumns.DATE_MODIFIED) * 1000
127128
val fileDirItem = ListItem(path, name, false, 0, size, modified, false)
128-
if (showHidden || !name.startsWith(".")) {
129+
if ((showHidden || !name.startsWith(".")) && activity?.getDoesFilePathExist(path) == true) {
129130
listItems.add(fileDirItem)
130131
}
131132
} while (cursor.moveToNext())

0 commit comments

Comments
 (0)