mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-15 21:45:07 -05:00
fixed npe for broken bookmarks
This commit is contained in:
parent
5d7597438b
commit
d98486d1ca
@ -813,8 +813,7 @@ public class XmppConnectionService extends Service {
|
|||||||
Conversation conversation = find(bookmark);
|
Conversation conversation = find(bookmark);
|
||||||
if (conversation != null) {
|
if (conversation != null) {
|
||||||
conversation.setBookmark(bookmark);
|
conversation.setBookmark(bookmark);
|
||||||
} else {
|
} else if (bookmark.autojoin() && bookmark.getJid() != null) {
|
||||||
if (bookmark.autojoin()) {
|
|
||||||
conversation = findOrCreateConversation(
|
conversation = findOrCreateConversation(
|
||||||
account, bookmark.getJid(), true);
|
account, bookmark.getJid(), true);
|
||||||
conversation.setBookmark(bookmark);
|
conversation.setBookmark(bookmark);
|
||||||
@ -823,7 +822,6 @@ public class XmppConnectionService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
account.setBookmarks(bookmarks);
|
account.setBookmarks(bookmarks);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -980,6 +978,9 @@ public class XmppConnectionService extends Service {
|
|||||||
public Conversation find(final List<Conversation> haystack,
|
public Conversation find(final List<Conversation> haystack,
|
||||||
final Account account,
|
final Account account,
|
||||||
final Jid jid) {
|
final Jid jid) {
|
||||||
|
if (jid == null ) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (Conversation conversation : haystack) {
|
for (Conversation conversation : haystack) {
|
||||||
if ((account == null || conversation.getAccount() == account)
|
if ((account == null || conversation.getAccount() == account)
|
||||||
&& (conversation.getContactJid().toBareJid().equals(jid.toBareJid()))) {
|
&& (conversation.getContactJid().toBareJid().equals(jid.toBareJid()))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user