fixed npe. fixed #717
This commit is contained in:
parent
2f02d8d398
commit
7ba41c6a8e
|
@ -235,15 +235,16 @@ public class ConversationActivity extends XmppActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateActionBarTitle(boolean titleShouldBeName) {
|
private void updateActionBarTitle(boolean titleShouldBeName) {
|
||||||
ActionBar ab = getActionBar();
|
final ActionBar ab = getActionBar();
|
||||||
|
final Conversation conversation = getSelectedConversation();
|
||||||
if (ab != null) {
|
if (ab != null) {
|
||||||
if (titleShouldBeName) {
|
if (titleShouldBeName && conversation != null) {
|
||||||
ab.setDisplayHomeAsUpEnabled(true);
|
ab.setDisplayHomeAsUpEnabled(true);
|
||||||
ab.setHomeButtonEnabled(true);
|
ab.setHomeButtonEnabled(true);
|
||||||
if (getSelectedConversation().getMode() == Conversation.MODE_SINGLE || useSubjectToIdentifyConference()) {
|
if (conversation.getMode() == Conversation.MODE_SINGLE || useSubjectToIdentifyConference()) {
|
||||||
ab.setTitle(getSelectedConversation().getName());
|
ab.setTitle(conversation.getName());
|
||||||
} else {
|
} else {
|
||||||
ab.setTitle(getSelectedConversation().getContactJid().toBareJid().toString());
|
ab.setTitle(conversation.getContactJid().toBareJid().toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ab.setDisplayHomeAsUpEnabled(false);
|
ab.setDisplayHomeAsUpEnabled(false);
|
||||||
|
|
Loading…
Reference in a new issue