mirror of https://github.com/apache/activemq.git
Fixing patch for AMQ-824 - adding NULL check for MessageConsumer::autoAcknowledge
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@425574 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
859caee9d2
commit
95fec7d0db
|
@ -216,21 +216,27 @@ void MessageConsumer::checkClosed() throw(CmsException)
|
||||||
p<IMessage> MessageConsumer::autoAcknowledge(p<IMessage> message)
|
p<IMessage> MessageConsumer::autoAcknowledge(p<IMessage> message)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if( message != NULL )
|
||||||
{
|
{
|
||||||
// Is the message an ActiveMQMessage? (throws bad_cast otherwise)
|
// Is the message an ActiveMQMessage? (throws bad_cast otherwise)
|
||||||
p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message) ;
|
p<ActiveMQMessage> activeMessage =
|
||||||
|
p_dyncast<ActiveMQMessage> (message);
|
||||||
|
|
||||||
// Register the handler for client acknowledgment
|
// Register the handler for client acknowledgment
|
||||||
activeMessage->setAcknowledger( smartify(this) ) ;
|
activeMessage->setAcknowledger( smartify(this) );
|
||||||
|
|
||||||
if( acknowledgementMode != ClientAckMode )
|
if( acknowledgementMode != ClientAckMode )
|
||||||
doAcknowledge(activeMessage) ;
|
doAcknowledge(activeMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch( bad_cast& bc )
|
catch( bad_cast& bc )
|
||||||
{
|
{
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
return message ;
|
|
||||||
|
// Return the message even if NULL, caller must determine what to do.
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue