Skip to content

Commit

Permalink
topic_tools: Check that output topic is valid in demux. Fixes #1366 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lfdebrux authored and mikepurvis committed Apr 24, 2018
1 parent abea595 commit 2b3f43d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/topic_tools/src/demux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ void in_cb(const boost::shared_ptr<ShapeShifter const>& msg)
ros::Duration(0.5).sleep();
}

// check that we have a valid topic
if (!g_selected->pub) return;

// finally: send out the message over the active publisher
g_selected->pub->publish(msg);
ROS_DEBUG("... and sent it out again!");
Expand Down Expand Up @@ -307,4 +310,3 @@ int main(int argc, char **argv)
g_pubs.clear();
return 0;
}

0 comments on commit 2b3f43d

Please sign in to comment.