DNSResolver: Bugfix: Always call completion handler
This commit is contained in:
parent
c04773276a
commit
8fee05969e
|
@ -53,7 +53,10 @@ class DNSResolver {
|
||||||
dispatchGroup.notify(queue: .main) {
|
dispatchGroup.notify(queue: .main) {
|
||||||
assert(endpoints.count == resolvedEndpoints.count)
|
assert(endpoints.count == resolvedEndpoints.count)
|
||||||
for (i, endpoint) in endpoints.enumerated() {
|
for (i, endpoint) in endpoints.enumerated() {
|
||||||
guard let endpoint = endpoint, let resolvedEndpoint = resolvedEndpoints[i] else { return }
|
guard let endpoint = endpoint, let resolvedEndpoint = resolvedEndpoints[i] else {
|
||||||
|
completionHandler(nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (isResolvedByDNSRequest[i]) {
|
if (isResolvedByDNSRequest[i]) {
|
||||||
DNSResolver.cache.setObject(resolvedEndpoint.stringRepresentation() as NSString,
|
DNSResolver.cache.setObject(resolvedEndpoint.stringRepresentation() as NSString,
|
||||||
forKey: endpoint.stringRepresentation() as NSString)
|
forKey: endpoint.stringRepresentation() as NSString)
|
||||||
|
|
Loading…
Reference in New Issue