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

Fixed NPE.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8356 b35dd754-fafc-0310-a699-88a17e54d16e
parent 976b7327
...@@ -269,14 +269,16 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -269,14 +269,16 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
else { else {
// Address is a bare JID so return all AVAILABLE resources of user // Address is a bare JID so return all AVAILABLE resources of user
List<String> sessions = usersSessions.get(route.toBareJID()); List<String> sessions = usersSessions.get(route.toBareJID());
// Select only available sessions if (sessions != null) {
for (String jid : sessions) { // Select only available sessions
ClientRoute clientRoute = usersCache.get(jid); for (String jid : sessions) {
if (clientRoute == null) { ClientRoute clientRoute = usersCache.get(jid);
clientRoute = anonymousUsersCache.get(jid); if (clientRoute == null) {
} clientRoute = anonymousUsersCache.get(jid);
if (clientRoute != null && clientRoute.isAvailable()) { }
jids.add(new JID(jid)); if (clientRoute != null && clientRoute.isAvailable()) {
jids.add(new JID(jid));
}
} }
} }
} }
...@@ -290,14 +292,7 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -290,14 +292,7 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
} }
else { else {
// Packet sent to remote server // Packet sent to remote server
byte[] nodeID = serversCache.get(route.getDomain()); jids.add(route);
if (nodeID != null) {
jids.add(route);
}
else {
// TODO Decide if we want to return address of remote server we don't have a route to
jids.add(route);
}
} }
return jids; return jids;
} }
......
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