mirror of https://github.com/apache/activemq.git
[AMQ-7347] Fix potential NPE when JMSException doesn't contain linkedException
This commit is contained in:
parent
4a4880301f
commit
58f5fdb572
|
@ -258,7 +258,12 @@ public class ProtocolConverter {
|
|||
LOG.warn("Exception occurred while processing a command: {}", exception.toString());
|
||||
} else {
|
||||
if (exception instanceof JMSException) {
|
||||
LOG.warn("Exception occurred for client {} ({}) processing: {} -> {} ({})", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString(), ((JMSException) exception).getLinkedException().toString());
|
||||
JMSException jmsException = (JMSException) exception;
|
||||
if (jmsException.getLinkedException() != null) {
|
||||
LOG.warn("Exception occurred for client {} ({}) processing: {} -> {} ({})", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString(), jmsException.getLinkedException().toString());
|
||||
} else {
|
||||
LOG.warn("Exception occurred for client {} ({}) processing: {} -> {}", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString());
|
||||
}
|
||||
} else {
|
||||
LOG.warn("Exception occurred for client {} ({}) processing: {} -> {}", connectionInfo.getClientId(), connectionInfo.getClientIp(), safeGetAction(command), exception.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue