Skip to content

Commit d30cda4

Browse files
committed
checking text in TEXT_VIEW_FACING marker to prevent crashes
1 parent 87742e4 commit d30cda4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rviz/default_plugin/markers/text_view_facing_marker.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ void TextViewFacingMarker::onNewMessage(const MarkerConstPtr& old_message, const
5757
{
5858
ROS_ASSERT(new_message->type == visualization_msgs::Marker::TEXT_VIEW_FACING);
5959

60+
if(new_message->text.empty()|| new_message->text.find_first_not_of(" \t\n\v\f\r") == std::string::npos)
61+
return;
6062
if (!text_)
6163
{
6264
text_ = new MovableText(new_message->text);

0 commit comments

Comments
 (0)