Skip to content

Commit

Permalink
fix crash in iOS 11: The app has encountered an unhandled exception: …
Browse files Browse the repository at this point in the history
…Completion handler passed to -[WKWebViewJavascriptBridge webView:decidePolicyForNavigationAction:decisionHandler:] was called more than once
  • Loading branch information
汤海波 committed Sep 20, 2017
1 parent 20cc7cd commit a0cfcf6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ - (void)webView:(WKWebView *)webView
[_base logUnkownMessage:url];
}
decisionHandler(WKNavigationActionPolicyCancel);
}

if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]) {
} else if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]) {
[_webViewDelegate webView:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler];
} else {
decisionHandler(WKNavigationActionPolicyAllow);
Expand Down

1 comment on commit a0cfcf6

@iosfighterlb
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't solve the problem on me.

Please sign in to comment.