diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index b977c73b072d84..fad088bd523a67 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -284,8 +284,15 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const } else { - ChipLogProgress(ExchangeManager, "Received Groupcast Message with GroupId 0x%04X (%d)", - packetHeader.GetDestinationGroupId().Value(), packetHeader.GetDestinationGroupId().Value()); + if (packetHeader.GetDestinationGroupId().HasValue()) + { + ChipLogProgress(ExchangeManager, "Received Groupcast Message with GroupId 0x%04X (%d)", + packetHeader.GetDestinationGroupId().Value(), packetHeader.GetDestinationGroupId().Value()); + } + else + { + ChipLogProgress(ExchangeManager, "Received Groupcast Message without GroupId"); + } } // Do not handle messages that don't match an existing exchange on an