diff options
author | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-10 19:43:23 +0100 |
---|---|---|
committer | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-10 19:43:23 +0100 |
commit | 158f5dd17cf4d34c5d696983fc21ae88c869ec94 (patch) | |
tree | 76efbb4eeddb60a70689807f64ce1bdbb58c446e /src/main/java/eu/siacs | |
parent | c89fdec0b158f7525ab6f95482088a5fb06278ea (diff) |
don't crash when selecting a conversation by uuid did not work
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index c9792260..926edef0 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -784,11 +784,9 @@ public class ConversationActivity extends XmppActivity } else if (conversationList.size() <= 0) { startActivity(new Intent(this, StartConversationActivity.class)); finish(); - } else if (getIntent() != null - && VIEW_CONVERSATION.equals(getIntent().getType())) { + } else if (getIntent() != null && VIEW_CONVERSATION.equals(getIntent().getType())) { handleViewConversationIntent(getIntent()); - } else if (mOpenConverstaion != null) { - selectConversationByUuid(mOpenConverstaion); + } else if (selectConversationByUuid(mOpenConverstaion)) { if (mPanelOpen) { showConversationsOverview(); } else { @@ -823,26 +821,32 @@ public class ConversationActivity extends XmppActivity String uuid = (String) intent.getExtras().get(CONVERSATION); String text = intent.getExtras().getString(TEXT, ""); String nick = intent.getExtras().getString(NICK,null); - selectConversationByUuid(uuid); - this.mConversationFragment.reInit(getSelectedConversation()); - if (nick!=null) { - this.mConversationFragment.highlightInConference(nick); - } else { - this.mConversationFragment.appendText(text); - } - hideConversationsOverview(); - openConversation(); - if (mContentView instanceof SlidingPaneLayout) { - updateActionBarTitle(true); //fixes bug where slp isn't properly closed yet + if (selectConversationByUuid(uuid)) { + this.mConversationFragment.reInit(getSelectedConversation()); + if (nick != null) { + this.mConversationFragment.highlightInConference(nick); + } else { + this.mConversationFragment.appendText(text); + } + hideConversationsOverview(); + openConversation(); + if (mContentView instanceof SlidingPaneLayout) { + updateActionBarTitle(true); //fixes bug where slp isn't properly closed yet + } } } - private void selectConversationByUuid(String uuid) { + private boolean selectConversationByUuid(String uuid) { + if (uuid == null) { + return false; + } for (Conversation aConversationList : conversationList) { if (aConversationList.getUuid().equals(uuid)) { setSelectedConversation(aConversationList); + return true; } } + return false; } @Override |