diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-08 21:28:27 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-08 21:28:27 +0100 |
commit | a13be0c48dd6a0ed94ff23295824f8635a0e5e2a (patch) | |
tree | 4eb6329d6ff75215c82214a26db0704da16ff791 /src/main/java/de/pixart | |
parent | 31e67ab197b9059e0b70f6ddb03e7dd48b82a711 (diff) |
catch all throwables when working with content provider to retrieve mime
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/MimeUtils.java | 7 |
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(); |