Commit 017dbb82 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Added debugging information when a session was not found.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1161 b35dd754-fafc-0310-a699-88a17e54d16e
parent f99fdacf
......@@ -138,6 +138,18 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
public IQ handleIQ(IQ packet) throws PacketException, UnauthorizedException {
ClientSession session = sessionManager.getSession(packet.getFrom());
IQ reply = null;
// If no session was found then answer an error (if possible)
if (session == null) {
Log.error("Error during registration. Session not found in " +
sessionManager.getPreAuthenticatedKeys() +
" for key " +
packet.getFrom());
// This error packet will probably won't make it through
reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.internal_server_error);
return reply;
}
// If inband registration is not allowed, return an error.
if (!enabled) {
reply = IQ.createResultIQ(packet);
......
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