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 {
// Analyze the disco result packet
if (IQ.Type.result == packet.getType()) {
Element child = packet.getChildElement();
for (Iterator it=child.elementIterator("identity"); it.hasNext();) {
Element identity = (Element) it.next();
String accountType = identity.attributeValue("type");
if ("registered".equals(accountType) || "admin".equals(accountType)) {
isRegistered = Boolean.TRUE;
break;
if (child != null) {
for (Iterator it=child.elementIterator("identity"); it.hasNext();) {
Element identity = (Element) it.next();
String accountType = identity.attributeValue("type");
if ("registered".equals(accountType) || "admin".equals(accountType)) {
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