aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-20 02:29:46 +0100
committerlookshe <github@lookshe.org>2016-03-20 02:29:46 +0100
commitad8e8344c0c051dd22adf76df624dd16cabcea28 (patch)
treea8e5818ef393087eb406df9d26bef3b36caa3f75 /src/main/java/de/thedevstack/conversationsplus/utils
parent6de11f38eaeb758692e0690f7150556d46d1f674 (diff)
parentfb00372269ab0ed9ed0fbc1bd502695ffc17dd1b (diff)
Merge branch 'trz/rebase' (early part) into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java b/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
index b556b72b..e16c5c5a 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/FileUtils.java
@@ -79,7 +79,14 @@ public final class FileUtils {
}
// MediaStore (and general)
else if (ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
- return getDataColumn(context, uri, null, null);
+ String path = getDataColumn(context, uri, null, null);
+ if (path != null) {
+ File file = new File(path);
+ if (!file.canRead()) {
+ return null;
+ }
+ }
+ return path;
}
// File
else if (ContentResolver.SCHEME_FILE.equals(uri.getScheme())) {