added pointer check to prevent the router from crashing when it receives the
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 1 May 2006 20:19:31 +0000 (20:19 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 1 May 2006 20:19:31 +0000 (20:19 +0000)
second bounce message on a recipient node

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@708 9efc2488-bf62-4759-914b-345cdb29e865

src/router/osrf_router.c

index ce97a07..87ab2a7 100644 (file)
@@ -274,11 +274,17 @@ transport_message* osrfRouterClassHandleBounce(
        
        } else { 
 
-               if( node->lastMessage ) {
-                       osrfLogDebug( OSRF_LOG_MARK, "Cloning lastMessage so next node can send it");
-                       lastSent = message_init( node->lastMessage->body,
-                               node->lastMessage->subject, node->lastMessage->thread, "", node->lastMessage->router_from );
-                       message_set_router_info( lastSent, node->lastMessage->router_from, NULL, NULL, NULL, 0 );
+               if( node ) {
+                       if( node->lastMessage ) {
+                               osrfLogDebug( OSRF_LOG_MARK, "Cloning lastMessage so next node can send it");
+                               lastSent = message_init( node->lastMessage->body,
+                                       node->lastMessage->subject, node->lastMessage->thread, "", node->lastMessage->router_from );
+                               message_set_router_info( lastSent, node->lastMessage->router_from, NULL, NULL, NULL, 0 );
+                       }
+               } else {
+
+                       osrfLogInfo(OSRF_LOG_MARK, "network error occurred after we removed the class.. ignoring");
+                       return NULL;
                }
        }