Commit a2612567 authored by Hiroshi Ichikawa's avatar Hiroshi Ichikawa Committed by Commit Bot

Fix a crash in -[CWVWebView updateWebStateVisibility].

The app crashes if the method is called after |_webState| is deallocated.

Change-Id: I8c06cddc8ea3a39fd2c8c5d05d4c17fa0bd071d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830251Reviewed-by: default avatarJohn Wu <jzw@chromium.org>
Commit-Queue: Hiroshi Ichikawa <ichikawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701017}
parent 9d432ecd
...@@ -592,6 +592,9 @@ static NSString* gUserAgentProduct = nil; ...@@ -592,6 +592,9 @@ static NSString* gUserAgentProduct = nil;
#pragma mark - Private methods #pragma mark - Private methods
- (void)updateWebStateVisibility { - (void)updateWebStateVisibility {
if (_webState == nullptr) {
return;
}
if (self.superview) { if (self.superview) {
_webState->WasShown(); _webState->WasShown();
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment