diff --git a/src/devices/wifi/dca-txop.cc b/src/devices/wifi/dca-txop.cc index 5701e1bc3..1630da924 100644 --- a/src/devices/wifi/dca-txop.cc +++ b/src/devices/wifi/dca-txop.cc @@ -37,7 +37,7 @@ NS_LOG_COMPONENT_DEFINE ("DcaTxop"); #undef NS_LOG_APPEND_CONTEXT -#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_low->GetAddress () << "] "; +#define NS_LOG_APPEND_CONTEXT if (m_low != 0) {std::clog << "[mac=" << m_low->GetAddress () << "] ";} namespace ns3 { diff --git a/src/devices/wifi/edca-txop-n.cc b/src/devices/wifi/edca-txop-n.cc index f703bc79d..91d9a6f38 100644 --- a/src/devices/wifi/edca-txop-n.cc +++ b/src/devices/wifi/edca-txop-n.cc @@ -38,7 +38,7 @@ NS_LOG_COMPONENT_DEFINE ("EdcaTxopN"); #undef NS_LOG_APPEND_CONTEXT -#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_low->GetAddress () << "] "; +#define NS_LOG_APPEND_CONTEXT if (m_low != 0) {std::clog << "[mac=" << m_low->GetAddress () << "] ";} namespace ns3 {