Commit 150ac992 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Improved #receivedAnswer to not fail if IQ result has no child element.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9152 b35dd754-fafc-0310-a699-88a17e54d16e
parent b98576e7
...@@ -373,12 +373,14 @@ public class UserManager implements IQResultListener { ...@@ -373,12 +373,14 @@ public class UserManager implements IQResultListener {
// Analyze the disco result packet // Analyze the disco result packet
if (IQ.Type.result == packet.getType()) { if (IQ.Type.result == packet.getType()) {
Element child = packet.getChildElement(); Element child = packet.getChildElement();
for (Iterator it=child.elementIterator("identity"); it.hasNext();) { if (child != null) {
Element identity = (Element) it.next(); for (Iterator it=child.elementIterator("identity"); it.hasNext();) {
String accountType = identity.attributeValue("type"); Element identity = (Element) it.next();
if ("registered".equals(accountType) || "admin".equals(accountType)) { String accountType = identity.attributeValue("type");
isRegistered = Boolean.TRUE; if ("registered".equals(accountType) || "admin".equals(accountType)) {
break; isRegistered = Boolean.TRUE;
break;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment