From 1505ec8c3574b0af64e9974b4c6eacd6bb88e98e Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 13 Jan 2015 09:47:32 -1000 Subject: [PATCH] catch ContentProvider SecurityExceptions to avoid crashes // FREEBIE --- src/org/thoughtcrime/securesms/mms/PartAuthority.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/mms/PartAuthority.java b/src/org/thoughtcrime/securesms/mms/PartAuthority.java index 2cc6883a5e..5ec3e2adac 100644 --- a/src/org/thoughtcrime/securesms/mms/PartAuthority.java +++ b/src/org/thoughtcrime/securesms/mms/PartAuthority.java @@ -39,10 +39,14 @@ public class PartAuthority { PartDatabase partDatabase = DatabaseFactory.getPartDatabase(context); int match = uriMatcher.match(uri); - switch (match) { + try { + switch (match) { case PART_ROW: return partDatabase.getPartStream(masterSecret, ContentUris.parseId(uri)); case THUMB_ROW: return partDatabase.getThumbnailStream(masterSecret, ContentUris.parseId(uri)); default: return context.getContentResolver().openInputStream(uri); + } + } catch (SecurityException se) { + throw new IOException(se); } }