Commit a03079b0 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed NPE when doing anonymous login.

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@2778 b35dd754-fafc-0310-a699-88a17e54d16e
parent 984529ba
...@@ -66,7 +66,7 @@ public class IQBindHandler extends IQHandler { ...@@ -66,7 +66,7 @@ public class IQBindHandler extends IQHandler {
Element child = reply.setChildElement("bind", "urn:ietf:params:xml:ns:xmpp-bind"); Element child = reply.setChildElement("bind", "urn:ietf:params:xml:ns:xmpp-bind");
// Check if the client specified a desired resource // Check if the client specified a desired resource
String resource = packet.getChildElement().elementTextTrim("resource"); String resource = packet.getChildElement().elementTextTrim("resource");
if (resource == null && resource.length() == 0) { if (resource == null || resource.length() == 0) {
// None was defined so use the random generated resource // None was defined so use the random generated resource
resource = session.getAddress().getResource(); resource = session.getAddress().getResource();
} }
......
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