From f92fb1b9f46813a45d05389869f974e906b07028 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Fri, 2 Nov 2018 18:10:51 +0530 Subject: [PATCH] DNSResolver: Bugfix: Always call completion handler Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/VPN/DNSResolver.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WireGuard/WireGuard/VPN/DNSResolver.swift b/WireGuard/WireGuard/VPN/DNSResolver.swift index 43e7c41..4ceabdc 100644 --- a/WireGuard/WireGuard/VPN/DNSResolver.swift +++ b/WireGuard/WireGuard/VPN/DNSResolver.swift @@ -53,7 +53,10 @@ class DNSResolver { dispatchGroup.notify(queue: .main) { assert(endpoints.count == resolvedEndpoints.count) 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]) { DNSResolver.cache.setObject(resolvedEndpoint.stringRepresentation() as NSString, forKey: endpoint.stringRepresentation() as NSString)