File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -539,12 +539,16 @@ void CameraDisplay::reset()
539539 // we will not receive another message after reset, i.e. the caminfo could not be recovered.
540540 // Thus, we reset caminfo only if unsubscribing.
541541
542- const std::string caminfo_topic = image_transport::getCameraInfoTopic (topic_property_->getTopicStd ());
543- boost::mutex::scoped_lock lock ( caminfo_mutex_ );
544- if (!current_caminfo_)
545- setStatus ( StatusProperty::Warn, " Camera Info" ,
546- " No CameraInfo received on [" + QString::fromStdString ( caminfo_topic ) + " ].\n "
547- " Topic may not exist." );
542+ const std::string topic = topic_property_->getTopicStd ();
543+ if (!topic.empty ())
544+ {
545+ const std::string caminfo_topic = image_transport::getCameraInfoTopic (topic);
546+ boost::mutex::scoped_lock lock ( caminfo_mutex_ );
547+ if (!current_caminfo_)
548+ setStatus ( StatusProperty::Warn, " Camera Info" ,
549+ " No CameraInfo received on [" + QString::fromStdString ( caminfo_topic ) + " ].\n "
550+ " Topic may not exist." );
551+ }
548552}
549553
550554} // namespace rviz
You can’t perform that action at this time.
0 commit comments