From abfed56af261cba816746ef0b661869449c27043 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 2375f45cb..7bae199f5 100644 --- a/rmw_fastrtps_cpp/src/subscription.cpp +++ b/rmw_fastrtps_cpp/src/subscription.cpp @@ -619,15 +619,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; } }