Skip to content

Commit 744f45c

Browse files
authored
Fixing crash (project-chip#36343)
1 parent f3a9fe9 commit 744f45c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm

+4
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ - (void)handleResolvedHostname:(const char *)hostName port:(uint16_t)port error:
120120
{
121121
std::lock_guard lock(sConnectivityMonitorLock);
122122

123+
if (hostName == NULL) {
124+
MTR_LOG_ERROR("%@ NULL host resolved, ignoring", self);
125+
return;
126+
}
123127
// dns_sd.h: must check and call deallocate if error is kDNSServiceErr_ServiceNotRunning
124128
if (error == kDNSServiceErr_ServiceNotRunning) {
125129
MTR_LOG_ERROR("%@ disconnected from dns-sd subsystem", self);

0 commit comments

Comments
 (0)