mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
show only media folders that exist
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
43323e1669
commit
750bfbc3c4
1 changed files with 2 additions and 2 deletions
|
@ -118,8 +118,8 @@ public final class MediaProvider {
|
||||||
filePath = cursorImages.getString(cursorImages.getColumnIndexOrThrow(
|
filePath = cursorImages.getString(cursorImages.getColumnIndexOrThrow(
|
||||||
MediaStore.MediaColumns.DATA));
|
MediaStore.MediaColumns.DATA));
|
||||||
|
|
||||||
// check if valid path
|
// check if valid path and file exists
|
||||||
if (filePath != null && filePath.lastIndexOf('/') > 0) {
|
if (filePath != null && filePath.lastIndexOf('/') > 0 && new File(filePath).exists()) {
|
||||||
mediaFolder.filePaths.add(filePath);
|
mediaFolder.filePaths.add(filePath);
|
||||||
mediaFolder.absolutePath = filePath.substring(0, filePath.lastIndexOf('/'));
|
mediaFolder.absolutePath = filePath.substring(0, filePath.lastIndexOf('/'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue