Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit d749c80

Browse files
committed
1 parent bccc9c3 commit d749c80

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

WordPressAuthenticator/GoogleSignIn/URL+GoogleSignIn.swift

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,9 @@ extension URL {
3030
if #available(iOS 16.0, *) {
3131
return googleSignInBaseURL.appending(queryItems: queryItems)
3232
} else {
33-
let baseURL = googleSignInBaseURL
34-
guard var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: false) else {
35-
throw URLError(
36-
.unsupportedURL,
37-
userInfo: [
38-
NSLocalizedDescriptionKey: "Could not create `URLComponents` instance from \(baseURL)"
39-
]
40-
)
41-
}
42-
33+
// Given `googleSignInBaseURL` is assumed as a valid URL, a `URLComponents` instance
34+
// should always be available.
35+
var components = URLComponents(url: googleSignInBaseURL, resolvingAgainstBaseURL: false)!
4336
components.queryItems = queryItems
4437
return try components.asURL()
4538
}

0 commit comments

Comments
 (0)