From ec6c181797d9d234f9577de6154ede4067d4b760 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 13 Nov 2024 22:01:02 +0000 Subject: [PATCH] Fixes from review. Signed-off-by: Chris Lalancette --- rmw_zenoh_cpp/src/detail/rmw_client_data.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp index 195f9ff6..cf0fcb4e 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp @@ -95,7 +95,7 @@ void client_data_drop(void * data) if (client_data == nullptr) { RMW_ZENOH_LOG_ERROR_NAMED( "rmw_zenoh_cpp", - "Unable to obtain client_data_t " + "Unable to obtain client_data_t from data in client_data_drop." ); return; } @@ -568,7 +568,13 @@ void ClientData::decrement_in_flight_and_conditionally_remove() if (is_shutdown_ && num_in_flight_ == 0) { rmw_context_impl_s * context_impl = static_cast(rmw_node_->data); + if (context_impl == nullptr) { + return; + } std::shared_ptr node_data = context_impl->get_node_data(rmw_node_); + if (node_data == nullptr) { + return; + } node_data->delete_client_data(rmw_client_); } }