Skip to content

Commit 1d89797

Browse files
EmreK03jpbusch
authored andcommitted
add check for empty vector in getMessageType function
Signed-off-by: Emre <[email protected]>
1 parent 2a06dc7 commit 1d89797

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rviz_common/include/rviz_common/properties/ros_topic_property.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class RVIZ_COMMON_PUBLIC RosTopicProperty : public EditableEnumProperty
6262
void setMessageTypes(const std::vector<QString> & message_types);
6363

6464
QString getMessageType() const
65-
{return message_types_.front();}
65+
{return message_types_.empty() ? QString() : message_types_.front();}
6666

6767
std::vector<QString> getMessageTypes() const
6868
{return message_types_;}

0 commit comments

Comments
 (0)