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

Fix NPE when there is no default session. JM-1040

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8097 b35dd754-fafc-0310-a699-88a17e54d16e
parent f9eb24c7
...@@ -879,7 +879,7 @@ public class SessionManager extends BasicModule { ...@@ -879,7 +879,7 @@ public class SessionManager extends BasicModule {
// Update the route for the session's BARE address // Update the route for the session's BARE address
Session defaultSession = sessionMap.getDefaultSession(true); Session defaultSession = sessionMap.getDefaultSession(true);
JID jid = JID jid =
new JID(defaultSession.getAddress().getNode(), defaultSession.getAddress().getDomain(), ""); new JID(session.getAddress().getNode(), session.getAddress().getDomain(), "");
if (defaultSession != null) { if (defaultSession != null) {
// Set the route to the bare JID to the session with highest priority // Set the route to the bare JID to the session with highest priority
routingTable.addRoute(jid, defaultSession); routingTable.addRoute(jid, defaultSession);
...@@ -920,8 +920,7 @@ public class SessionManager extends BasicModule { ...@@ -920,8 +920,7 @@ public class SessionManager extends BasicModule {
defaultSession = resources.getDefaultSession(true); defaultSession = resources.getDefaultSession(true);
} }
// Update the route to the bareJID with the session with highest priority // Update the route to the bareJID with the session with highest priority
JID defaultAddress = JID defaultAddress = new JID(sender.getNode(), sender.getDomain(), "");
new JID(defaultSession.getAddress().getNode(), defaultSession.getAddress().getDomain(), "");
// Update the route to the bare JID // Update the route to the bare JID
if (defaultSession != null) { if (defaultSession != null) {
boolean hadDefault = routingTable.getRoute(defaultAddress) != null; boolean hadDefault = routingTable.getRoute(defaultAddress) != null;
......
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