diff --git a/ecal/core/src/readwrite/ecal_reader.cpp b/ecal/core/src/readwrite/ecal_reader.cpp index 2da7238dbb..3cede5f818 100644 --- a/ecal/core/src/readwrite/ecal_reader.cpp +++ b/ecal/core/src/readwrite/ecal_reader.cpp @@ -658,7 +658,7 @@ namespace eCAL { const std::lock_guard lock(m_event_callback_map_sync); auto iter = m_event_callback_map.find(sub_event_connected); - if(iter != m_event_callback_map.end()) + if (iter != m_event_callback_map.end() && iter->second) { SSubEventCallbackData data; data.type = sub_event_connected; @@ -671,7 +671,7 @@ namespace eCAL { const std::lock_guard lock(m_event_callback_map_sync); auto iter = m_event_callback_map.find(sub_event_disconnected); - if(iter != m_event_callback_map.end()) + if (iter != m_event_callback_map.end() && iter->second) { SSubEventCallbackData data; data.type = sub_event_disconnected; @@ -785,7 +785,7 @@ namespace eCAL { std::lock_guard lock(m_event_callback_map_sync); auto iter = m_event_callback_map.find(sub_event_timeout); - if(iter != m_event_callback_map.end()) + if(iter != m_event_callback_map.end() && iter->second) { SSubEventCallbackData data; data.type = sub_event_timeout; diff --git a/ecal/core/src/readwrite/ecal_writer.cpp b/ecal/core/src/readwrite/ecal_writer.cpp index fe0004607e..d019af1677 100644 --- a/ecal/core/src/readwrite/ecal_writer.cpp +++ b/ecal/core/src/readwrite/ecal_writer.cpp @@ -984,7 +984,7 @@ namespace eCAL { const std::lock_guard lock(m_event_callback_map_sync); auto iter = m_event_callback_map.find(pub_event_connected); - if (iter != m_event_callback_map.end()) + if (iter != m_event_callback_map.end() && iter->second) { SPubEventCallbackData data; data.type = pub_event_connected; @@ -997,7 +997,7 @@ namespace eCAL { const std::lock_guard lock(m_event_callback_map_sync); auto iter = m_event_callback_map.find(pub_event_disconnected); - if (iter != m_event_callback_map.end()) + if (iter != m_event_callback_map.end() && iter->second) { SPubEventCallbackData data; data.type = pub_event_disconnected;