Stop crash on multiple attachment selected

Fixed #5272
Closes #5440
// FREEBIE
This commit is contained in:
Marcus Ofenhed 2016-04-12 08:40:48 +02:00 committed by Moxie Marlinspike
parent 209d8148ab
commit 31970c4644
2 changed files with 3 additions and 0 deletions

View File

@ -1059,6 +1059,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
} }
private void setMedia(Uri uri, MediaType mediaType) { private void setMedia(Uri uri, MediaType mediaType) {
if (uri == null) return;
attachmentManager.setMedia(masterSecret, uri, mediaType, getCurrentMediaConstraints()); attachmentManager.setMedia(masterSecret, uri, mediaType, getCurrentMediaConstraints());
} }

View File

@ -72,6 +72,8 @@ public class MediaUtil {
} }
public static @Nullable String getMimeType(Context context, Uri uri) { public static @Nullable String getMimeType(Context context, Uri uri) {
if (uri == null) return null;
if (PersistentBlobProvider.isAuthority(context, uri)) { if (PersistentBlobProvider.isAuthority(context, uri)) {
return PersistentBlobProvider.getMimeType(context, uri); return PersistentBlobProvider.getMimeType(context, uri);
} }