diff --git a/tools/topic_tools/src/mux.cpp b/tools/topic_tools/src/mux.cpp index f6b0b43939..e13205d9dc 100644 --- a/tools/topic_tools/src/mux.cpp +++ b/tools/topic_tools/src/mux.cpp @@ -167,7 +167,7 @@ void in_cb(const boost::shared_ptr& msg, } } - if (s != g_selected->msg) + if (g_selected == g_subs.end() || s != g_selected->msg) return; // If we're in lazy subscribe mode, and nobody's listening, then unsubscribe