From b0bd6ad729cac559a6c12744ed98e5369e923df4 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Fri, 31 Mar 2017 16:52:50 -0700 Subject: [PATCH] Fix for crash when opening group conversation Fixes #6464 // FREEBIE --- src/org/thoughtcrime/securesms/ConversationItem.java | 3 +-- src/org/thoughtcrime/securesms/util/MediaUtil.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 474e919277..9cd136129c 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -27,7 +27,6 @@ import android.net.Uri; import android.os.AsyncTask; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.text.util.Linkify; @@ -339,7 +338,7 @@ public class ConversationItem extends LinearLayout documentViewStub.get().setDownloadClickListener(downloadClickListener); documentViewStub.get().setOnLongClickListener(passthroughClickListener); - bodyText.setLayoutParams(new ActionBar.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + bodyText.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); } else if (hasThumbnail(messageRecord)) { mediaThumbnailStub.get().setVisibility(View.VISIBLE); if (audioViewStub.resolved()) audioViewStub.get().setVisibility(View.GONE); diff --git a/src/org/thoughtcrime/securesms/util/MediaUtil.java b/src/org/thoughtcrime/securesms/util/MediaUtil.java index 793df1ce3e..38a175b5bf 100644 --- a/src/org/thoughtcrime/securesms/util/MediaUtil.java +++ b/src/org/thoughtcrime/securesms/util/MediaUtil.java @@ -83,7 +83,7 @@ public class MediaUtil { slide = new AudioSlide(context, attachment); } else if (isMms(attachment.getContentType())) { slide = new MmsSlide(context, attachment); - } else { + } else if (attachment.getContentType() != null) { slide = new DocumentSlide(context, attachment); }