aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-02-08 21:28:27 +0100
committerChristian Schneppe <christian@pix-art.de>2017-02-08 21:28:27 +0100
commita13be0c48dd6a0ed94ff23295824f8635a0e5e2a (patch)
tree4eb6329d6ff75215c82214a26db0704da16ff791 /src/main/java/de/pixart
parent31e67ab197b9059e0b70f6ddb03e7dd48b82a711 (diff)
catch all throwables when working with content provider to retrieve mime
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/utils/MimeUtils.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/MimeUtils.java b/src/main/java/de/pixart/messenger/utils/MimeUtils.java
index bdcd82bae..0e52e283f 100644
--- a/src/main/java/de/pixart/messenger/utils/MimeUtils.java
+++ b/src/main/java/de/pixart/messenger/utils/MimeUtils.java
@@ -505,7 +505,12 @@ public final class MimeUtils {
public static String guessMimeTypeFromUri(Context context, Uri uri) {
// try the content resolver
- String mimeType = context.getContentResolver().getType(uri);
+ String mimeType;
+ try {
+ mimeType = context.getContentResolver().getType(uri);
+ } catch (Throwable throwable) {
+ mimeType = null;
+ }
// try the extension
if (mimeType == null && uri.getPath() != null) {
String path = uri.getPath();