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 {
// Update the route for the session's BARE address
Session defaultSession = sessionMap.getDefaultSession(true);
JID jid =
new JID(defaultSession.getAddress().getNode(), defaultSession.getAddress().getDomain(), "");
new JID(session.getAddress().getNode(), session.getAddress().getDomain(), "");
if (defaultSession != null) {
// Set the route to the bare JID to the session with highest priority
routingTable.addRoute(jid, defaultSession);
......@@ -920,8 +920,7 @@ public class SessionManager extends BasicModule {
defaultSession = resources.getDefaultSession(true);
}
// Update the route to the bareJID with the session with highest priority
JID defaultAddress =
new JID(defaultSession.getAddress().getNode(), defaultSession.getAddress().getDomain(), "");
JID defaultAddress = new JID(sender.getNode(), sender.getDomain(), "");
// Update the route to the bare JID
if (defaultSession != 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