Commit cf9745ae authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed NPE caused when removing non-authenticated sessions.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@286 b35dd754-fafc-0310-a699-88a17e54d16e
parent a9d53178
...@@ -380,4 +380,13 @@ public class XMPPAddress implements Cacheable { ...@@ -380,4 +380,13 @@ public class XMPPAddress implements Cacheable {
return cachedPrep.hashCode(); return cachedPrep.hashCode();
} }
} }
/**
* Returns true if all the portions of the addresss are null.
*
* @return true if all the portions of the addresss are null.
*/
public boolean isEmpty() {
return name == null && host == null && resource == null;
}
} }
...@@ -803,7 +803,7 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -803,7 +803,7 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
offline.setAvailable(false); offline.setAvailable(false);
router.route(offline); router.route(offline);
} }
if (session.getAddress() != null && routingTable != null) { if (session.getAddress() != null && routingTable != null && !session.getAddress().isEmpty()) {
routingTable.removeRoute(session.getAddress()); routingTable.removeRoute(session.getAddress());
if (sessionMap != null) { if (sessionMap != null) {
if (sessionMap.isEmpty()) { if (sessionMap.isEmpty()) {
......
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