From 7e6d2c3145647551480f69336eec574e8560a94b Mon Sep 17 00:00:00 2001 From: Chen Lihui Date: Mon, 27 Feb 2023 12:37:15 +0800 Subject: [PATCH] get valid subscription handle even if cft not supported Signed-off-by: Chen Lihui --- rmw_fastrtps_cpp/src/subscription.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rmw_fastrtps_cpp/src/subscription.cpp b/rmw_fastrtps_cpp/src/subscription.cpp index 3d3a3d81b..04421cd69 100644 --- a/rmw_fastrtps_cpp/src/subscription.cpp +++ b/rmw_fastrtps_cpp/src/subscription.cpp @@ -239,15 +239,13 @@ create_subscription( subscription_options->content_filter_options; if (nullptr != options->filter_expression) { eprosima::fastdds::dds::ContentFilteredTopic * filtered_topic = nullptr; - if (!rmw_fastrtps_shared_cpp::create_content_filtered_topic( + if (rmw_fastrtps_shared_cpp::create_content_filtered_topic( dds_participant, des_topic, topic_name_mangled, options, &filtered_topic)) { - RMW_SET_ERROR_MSG("create_contentfilteredtopic() failed to create contentfilteredtopic"); - return nullptr; + info->filtered_topic_ = filtered_topic; + des_topic = filtered_topic; } - info->filtered_topic_ = filtered_topic; - des_topic = filtered_topic; } }