aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-27 10:30:06 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-27 10:30:06 +0100
commit7ba41c6a8e3b632647329edb35a716077e22fbfb (patch)
tree7ffc8ae751d84941106686c433a21ffa18b8088d /src/main
parent2f02d8d3982bebb7e7c87dc45548f2650d388808 (diff)
fixed npe. fixed #717
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 0277f155..0f9761e5 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -235,15 +235,16 @@ public class ConversationActivity extends XmppActivity implements
}
private void updateActionBarTitle(boolean titleShouldBeName) {
- ActionBar ab = getActionBar();
+ final ActionBar ab = getActionBar();
+ final Conversation conversation = getSelectedConversation();
if (ab != null) {
- if (titleShouldBeName) {
+ if (titleShouldBeName && conversation != null) {
ab.setDisplayHomeAsUpEnabled(true);
ab.setHomeButtonEnabled(true);
- if (getSelectedConversation().getMode() == Conversation.MODE_SINGLE || useSubjectToIdentifyConference()) {
- ab.setTitle(getSelectedConversation().getName());
+ if (conversation.getMode() == Conversation.MODE_SINGLE || useSubjectToIdentifyConference()) {
+ ab.setTitle(conversation.getName());
} else {
- ab.setTitle(getSelectedConversation().getContactJid().toBareJid().toString());
+ ab.setTitle(conversation.getContactJid().toBareJid().toString());
}
} else {
ab.setDisplayHomeAsUpEnabled(false);