aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-29 19:09:28 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-29 19:09:28 +0100
commitd98486d1cab6083688b68c21d663ab3f9ad572bc (patch)
treef6272cf78405198974c6625fee9544393c180cbb /src/main/java/eu
parent5d7597438b2becc02fc90b964d88c2eae6de0304 (diff)
fixed npe for broken bookmarks
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 12237f73..128f61a1 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -813,13 +813,11 @@ public class XmppConnectionService extends Service {
Conversation conversation = find(bookmark);
if (conversation != null) {
conversation.setBookmark(bookmark);
- } else {
- if (bookmark.autojoin()) {
- conversation = findOrCreateConversation(
- account, bookmark.getJid(), true);
- conversation.setBookmark(bookmark);
- joinMuc(conversation);
- }
+ } else if (bookmark.autojoin() && bookmark.getJid() != null) {
+ conversation = findOrCreateConversation(
+ account, bookmark.getJid(), true);
+ conversation.setBookmark(bookmark);
+ joinMuc(conversation);
}
}
}
@@ -980,6 +978,9 @@ public class XmppConnectionService extends Service {
public Conversation find(final List<Conversation> haystack,
final Account account,
final Jid jid) {
+ if (jid == null ) {
+ return null;
+ }
for (Conversation conversation : haystack) {
if ((account == null || conversation.getAccount() == account)
&& (conversation.getContactJid().toBareJid().equals(jid.toBareJid()))) {