From aa37d6e7f996761f0d1fd20fcb02f06daece90f9 Mon Sep 17 00:00:00 2001 From: Rhodey Orbits Date: Fri, 12 Jun 2015 12:02:41 -0700 Subject: [PATCH] only open media preview when there is something to preview. Fixes #3389 Closes #3412 // FREEBIE --- src/org/thoughtcrime/securesms/ConversationItem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 56da3eece4..95ede6b836 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -403,7 +403,9 @@ public class ConversationItem extends LinearLayout { public void onClick(final View v, final Slide slide) { if (!batchSelected.isEmpty()) { selectionClickListener.onItemClick(null, ConversationItem.this, -1, -1); - } else if (MediaPreviewActivity.isContentTypeSupported(slide.getContentType())) { + } else if (MediaPreviewActivity.isContentTypeSupported(slide.getContentType()) && + slide.getThumbnailUri() != null) + { Intent intent = new Intent(context, MediaPreviewActivity.class); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setDataAndType(slide.getUri(), slide.getContentType()); @@ -411,7 +413,7 @@ public class ConversationItem extends LinearLayout { intent.putExtra(MediaPreviewActivity.DATE_EXTRA, messageRecord.getDateReceived()); context.startActivity(intent); - } else { + } else if (slide.getThumbnailUri() != null) { AlertDialogWrapper.Builder builder = new AlertDialogWrapper.Builder(context); builder.setTitle(R.string.ConversationItem_view_secure_media_question); builder.setIconAttribute(R.attr.dialog_alert_icon);