From 25a81bcf2496d029c6f3f34b49743547be501ecb Mon Sep 17 00:00:00 2001 From: pjechris <pjechris@users.noreply.github.com> Date: Mon, 17 Oct 2022 16:29:57 +0200 Subject: [PATCH] fix(foundation): Fixed crash in URLSession.data(for:) (#17) --- .../{URLSession+Publisher.swift => URLSession+Async.swift} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Sources/SimpleHTTPFoundation/Foundation/{URLSession+Publisher.swift => URLSession+Async.swift} (92%) diff --git a/Sources/SimpleHTTPFoundation/Foundation/URLSession+Publisher.swift b/Sources/SimpleHTTPFoundation/Foundation/URLSession+Async.swift similarity index 92% rename from Sources/SimpleHTTPFoundation/Foundation/URLSession+Publisher.swift rename to Sources/SimpleHTTPFoundation/Foundation/URLSession+Async.swift index 377b871..e2540ed 100644 --- a/Sources/SimpleHTTPFoundation/Foundation/URLSession+Publisher.swift +++ b/Sources/SimpleHTTPFoundation/Foundation/URLSession+Async.swift @@ -6,7 +6,7 @@ extension URLSession { try await withCheckedThrowingContinuation { promise in self.dataTask(with: urlRequest) { data, response, error in if let error = error { - promise.resume(throwing: error) + return promise.resume(throwing: error) } guard let data = data, let response = response else {