Skip to content

Commit 409d084

Browse files
markmarkswellp2
authored andcommitted
Fix for XCode9 assertion error (#227)
When running in iOS 11/XCode 9, you get an exception if you call 'decisionHandler()' twice. This strategic return prevents that. Also - swift 3.2 compile fix for unneeded !
1 parent e19f1ed commit 409d084

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/iOS/OAuth2WebViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ open class OAuth2WebViewController: UIViewController, WKNavigationDelegate {
5151
interceptComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)
5252
}
5353
else {
54-
oauth?.logger?.debug("OAuth2", msg: "Failed to parse URL \(interceptURLString!), discarding")
54+
oauth?.logger?.debug("OAuth2", msg: "Failed to parse URL \(interceptURLString), discarding")
5555
self.interceptURLString = nil
5656
}
5757
}
@@ -209,6 +209,7 @@ open class OAuth2WebViewController: UIViewController, WKNavigationDelegate {
209209
else {
210210
decisionHandler(.allow)
211211
}
212+
return
212213
}
213214
}
214215
decisionHandler(.allow)

0 commit comments

Comments
 (0)