Skip to content

Commit

Permalink
fix crash on FBSDKWebViewAppLinkResolverWebViewDelegate (#1624)
Browse files Browse the repository at this point in the history
Summary:
Thanks for proposing a pull request!

To help us review the request, please complete the following:

- [x] sign [contributor license agreement](https://developers.facebook.com/opensource/cla)
- [x] I've ensured that all existing tests pass and added tests (when/where necessary)
- [x] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary)
- [x] I've added the proper label to this pull request (e.g. `bug` for bug fixes)

## Pull Request Details

It should solve this crash

#1596 (comment)

Pull Request resolved: #1624

Reviewed By: dreamolight

Differential Revision: D26103826

Pulled By: joesus

fbshipit-source-id: 3589b6b610b65e9a14506e15980aca1a8f93bd85
  • Loading branch information
Kry256 authored and facebook-github-bot committed Jan 28, 2021
1 parent fdedf3b commit 82ebe1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions FBSDKCoreKit/FBSDKCoreKit/AppLink/FBSDKWebViewAppLinkResolver.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ - (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigatio

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
{
if (self.hasLoaded) {
self.didFinishLoad(webView);
decisionHandler(WKNavigationActionPolicyCancel);
}

self.hasLoaded = YES;
decisionHandler(WKNavigationActionPolicyAllow);
if (self.hasLoaded) {
self.didFinishLoad(webView);
decisionHandler(WKNavigationActionPolicyCancel);
} else {
self.hasLoaded = YES;
decisionHandler(WKNavigationActionPolicyAllow);
}
}

@end
Expand Down

0 comments on commit 82ebe1f

Please sign in to comment.