Fix for potential NPE

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1493110 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-06-14 15:18:51 +00:00
parent 8ab1934520
commit 205c6bec88
1 changed files with 4 additions and 1 deletions

View File

@ -348,8 +348,11 @@ class AmqpProtocolConverter {
MessageDispatch md = (MessageDispatch) command;
ConsumerContext consumerContext = subscriptionsByConsumerId.get(md.getConsumerId());
if (consumerContext != null) {
if (LOG.isTraceEnabled()) {
// End of Queue Browse will have no Message object.
if (LOG.isTraceEnabled() && md.getMessage() != null) {
LOG.trace("Dispatching MessageId:{} to consumer", md.getMessage().getMessageId());
} else {
LOG.trace("Dispatching End of Browse Command to consumer {}", md.getConsumerId());
}
consumerContext.onMessageDispatch(md);
}