From: erickson Date: Mon, 1 May 2006 20:19:31 +0000 (+0000) Subject: added pointer check to prevent the router from crashing when it receives the X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a0b915fa2a6f047485526241cdb39c0f7a9116d2;p=opensrf%2Fbjwebb.git added pointer check to prevent the router from crashing when it receives the second bounce message on a recipient node git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@708 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/router/osrf_router.c b/src/router/osrf_router.c index ce97a07..87ab2a7 100644 --- a/src/router/osrf_router.c +++ b/src/router/osrf_router.c @@ -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; } }