fixed npe when missing instructions on failed register
This commit is contained in:
parent
db726a59b8
commit
d74e8a8a0e
|
@ -647,10 +647,8 @@ public class XmppConnection implements Runnable {
|
|||
if (packet.query().hasChild("username")
|
||||
&& (packet.query().hasChild("password"))) {
|
||||
final IqPacket register = new IqPacket(IqPacket.TYPE.SET);
|
||||
final Element username = new Element("username")
|
||||
.setContent(account.getUsername());
|
||||
final Element password = new Element("password")
|
||||
.setContent(account.getPassword());
|
||||
final Element username = new Element("username").setContent(account.getUsername());
|
||||
final Element password = new Element("password").setContent(account.getPassword());
|
||||
register.query("jabber:iq:register").addChild(username);
|
||||
register.query().addChild(password);
|
||||
sendIqPacket(register, new OnIqPacketReceived() {
|
||||
|
@ -677,7 +675,7 @@ public class XmppConnection implements Runnable {
|
|||
disconnect(true);
|
||||
Log.d(Config.LOGTAG, account.getJid().toBareJid()
|
||||
+ ": could not register. instructions are"
|
||||
+ instructions.getContent());
|
||||
+ instructions != null ? instructions.getContent() : "");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue