Commit 483ea2e9 authored by Dave Cridland's avatar Dave Cridland

Merge pull request #411 from tevans/IQRouter_npe

Fix NPE when handling routing failures
parents ff7b99cf 696fd54d
......@@ -433,6 +433,12 @@ public class IQRouter extends BasicModule {
Log.error("Cannot reply an IQ error to another IQ error: " + originalPacket.toXML());
return;
}
if (originalPacket.getFrom() == null) {
if (Log.isDebugEnabled()) {
Log.debug("Original IQ has no sender for reply; dropped: " + originalPacket.toXML());
}
return;
}
IQ reply = IQ.createResultIQ(originalPacket);
reply.setChildElement(originalPacket.getChildElement().createCopy());
reply.setError(condition);
......
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