From 13d73a196ca1482a0556bddb2e7c5df8f8c65e54 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 15 May 2014 10:27:36 +0200 Subject: [PATCH] fixed npe --- src/eu/siacs/conversations/ui/ConversationFragment.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index 8d29ce8b..708c7f68 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -5,12 +5,9 @@ import java.util.HashMap; import java.util.List; import java.util.Set; -import org.openintents.openpgp.OpenPgpError; - import net.java.otr4j.session.SessionStatus; import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.PgpEngine; -import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; @@ -31,7 +28,6 @@ import android.content.SharedPreferences; import android.content.IntentSender.SendIntentException; import android.graphics.Bitmap; import android.graphics.Typeface; -import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.text.Editable; @@ -267,7 +263,9 @@ public class ConversationFragment extends Fragment { } private void displayInfoMessage(ViewHolder viewHolder, int r) { - viewHolder.download_button.setVisibility(View.GONE); + if (viewHolder.download_button!=null) { + viewHolder.download_button.setVisibility(View.GONE); + } viewHolder.image.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.VISIBLE); viewHolder.messageBody.setText(getString(r));