Skip to content

Commit

Permalink
make clang-tidy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Apr 26, 2024
1 parent b4734e5 commit d25aeba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/dnssd/Discovery_ImplPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ static void HandleNodeBrowse(void * context, DnssdService * services, size_t ser
discoveryContext->Retain();
// For some platforms browsed services are already resolved, so verify if resolve is really needed or call resolve callback

auto ipAddress = services[i].mAddress;

// Check if SRV, TXT and AAAA records were received in DNS responses
if (strlen(services[i].mHostName) == 0 || services[i].mTextEntrySize == 0 || !services[i].mAddress.has_value())
if (strlen(services[i].mHostName) == 0 || services[i].mTextEntrySize == 0 || !ipAddress.has_value())
{
ChipDnssdResolve(&services[i], services[i].mInterface, HandleNodeResolve, context);
}
else
{
Inet::IPAddress * address = &(*services[i].mAddress);
Inet::IPAddress * address = &(*ipAddress);
HandleNodeResolve(context, &services[i], Span<Inet::IPAddress>(address, 1), error);
}
}
Expand Down

0 comments on commit d25aeba

Please sign in to comment.