fix NPE during bookmark creation
closes #4312 fixes #4211 thank you @singpolyma
This commit is contained in:
parent
e3cae4cb1d
commit
d7637192e2
|
@ -1793,7 +1793,9 @@ public class XmppConnectionService extends Service {
|
|||
public void createBookmark(final Account account, final Bookmark bookmark) {
|
||||
account.putBookmark(bookmark);
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
if (connection.getFeatures().bookmarks2()) {
|
||||
if (connection == null) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid()+": no connection. ignoring bookmark creation");
|
||||
} else if (connection.getFeatures().bookmarks2()) {
|
||||
final Element item = mIqGenerator.publishBookmarkItem(bookmark);
|
||||
pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS2, item, bookmark.getJid().asBareJid().toEscapedString(), PublishOptions.persistentWhitelistAccessMaxItems());
|
||||
} else if (connection.getFeatures().bookmarksConversion()) {
|
||||
|
|
Loading…
Reference in a new issue