INT-1529 NPE in inbound gateway when reply is null

This commit is contained in:
Gary Russell
2010-10-17 12:30:05 -04:00
parent b265312903
commit d09dfd7c45

View File

@@ -46,10 +46,16 @@ public class TcpInboundGateway extends MessagingGatewaySupport implements TcpLis
public boolean onMessage(Message<?> message) {
Message<?> reply = this.sendAndReceiveMessage(message);
if (reply == null) {
if (logger.isDebugEnabled()) {
logger.debug("null reply received for " + message + " nothing to send");
}
return false;
}
String connectionId = (String) message.getHeaders().get(IpHeaders.CONNECTION_ID);
TcpConnection connection = connections.get(connectionId);
if (connection == null) {
logger.error("Connection " + connectionId + " not found");
logger.error("Connection " + connectionId + " not found when processing reply for " + message);
return false;
}
try {