From bbd37c6cd4fde518a34fc12914d84eee7cc9b820 Mon Sep 17 00:00:00 2001 From: Bernd Date: Wed, 20 Feb 2019 18:49:03 +0100 Subject: [PATCH] Fix Crash (#1066) * fix possible npe * Update ConversationViewHolder.java * revert unneded changes --- .../tusky/components/conversation/ConversationViewHolder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationViewHolder.java index 0857960a0..44bc89f56 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationViewHolder.java @@ -107,7 +107,9 @@ public class ConversationViewHolder extends StatusBaseViewHolder { private void setConversationName(List accounts) { Context context = conversationNameTextView.getContext(); String conversationName; - if(accounts.size() == 1) { + if(accounts.size() == 0) { + conversationName = " "; + }else if(accounts.size() == 1) { conversationName = context.getString(R.string.conversation_1_recipients, accounts.get(0).getUsername()); } else if(accounts.size() == 2) { conversationName = context.getString(R.string.conversation_2_recipients, accounts.get(0).getUsername(), accounts.get(1).getUsername());