Commit f12810a0 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Fix crash on app exit in BrowserViewWrangler

After the switch to use WebStateListObserver instead of TabModelObserver,
BrowserViewWrangler will get a notification that the active webState is
changing when the app quits (the active webState is changing to nullptr).
This in turn causes a call to -updateDeviceSharingManager, which explodes
when there's no active WebState.

The fix is to not call -updateDeviceSharingManager with a nullptr new
active web state.


Bug: 968475
Change-Id: I78b25c627d311d2e2a3f152e8cd8f663161962bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645230
Auto-Submit: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarDavid Jean <djean@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666270}
parent cc0f372f
...@@ -296,7 +296,9 @@ ...@@ -296,7 +296,9 @@
oldWebState:(web::WebState*)oldWebState oldWebState:(web::WebState*)oldWebState
atIndex:(int)atIndex atIndex:(int)atIndex
reason:(int)reason { reason:(int)reason {
[self updateDeviceSharingManager]; if (newWebState) {
[self updateDeviceSharingManager];
}
} }
#pragma mark - CRWWebStateObserver #pragma mark - CRWWebStateObserver
......
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