activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r425574 - /incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp
Date Wed, 26 Jul 2006 00:44:39 GMT
Author: nmittler
Date: Tue Jul 25 17:44:39 2006
New Revision: 425574

URL: http://svn.apache.org/viewvc?rev=425574&view=rev
Log:
Fixing patch for AMQ-824 - adding NULL check for MessageConsumer::autoAcknowledge

Modified:
    incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp?rev=425574&r1=425573&r2=425574&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp Tue Jul
25 17:44:39 2006
@@ -217,20 +217,26 @@
 {
     try
     {
-        // Is the message an ActiveMQMessage? (throws bad_cast otherwise)
-        p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message)
;
+        if( message != NULL )
+        {
+            // Is the message an ActiveMQMessage? (throws bad_cast otherwise)
+            p<ActiveMQMessage> activeMessage = 
+                p_dyncast<ActiveMQMessage> (message);
+    
+            // Register the handler for client acknowledgment
+            activeMessage->setAcknowledger( smartify(this) );
 
-        // Register the handler for client acknowledgment
-        activeMessage->setAcknowledger( smartify(this) ) ;
-
-        if( acknowledgementMode != ClientAckMode )
-            doAcknowledge(activeMessage) ;
+            if( acknowledgementMode != ClientAckMode )
+                doAcknowledge(activeMessage);
+        }         
     }
     catch( bad_cast& bc )
     {
         // ignore
     }
-    return message ;
+
+    // Return the message even if NULL, caller must determine what to do.
+    return message;
 }
 
 /*



Mime
View raw message