Skip to content

Commit 28858af

Browse files
committed
fix faulty return statement for primitive messages
1 parent 88fa08e commit 28858af

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mqtt_client/src/MqttClient.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,15 @@ void MqttClient::ros2mqtt(const topic_tools::ShapeShifter::ConstPtr& ros_msg,
503503
// resolve ROS messages to primitive strings if possible
504504
std::string payload;
505505
bool found_primitive = primitiveRosMessageToString(ros_msg, payload);
506-
if (found_primitive)
506+
if (found_primitive) {
507507
payload_buffer = std::vector<uint8_t>(payload.begin(), payload.end());
508-
else
508+
} else {
509509
NODELET_WARN(
510510
"Cannot send ROS message of type '%s' as primitive message, "
511511
"check supported primitive types",
512512
ros_msg_type.name.c_str());
513-
return;
513+
return;
514+
}
514515

515516
} else { // publish as complete ROS message incl. ROS message type
516517

0 commit comments

Comments
 (0)