From a13be0c48dd6a0ed94ff23295824f8635a0e5e2a Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 8 Feb 2017 21:28:27 +0100 Subject: catch all throwables when working with content provider to retrieve mime --- src/main/java/de/pixart/messenger/utils/MimeUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart') 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(); -- cgit v1.2.3