fix: ensure web_contents is not nullptr in UpdateDraggableRegions (#21955)

* fix: ensure web_contents is not nullptr in UpdateDraggableRegions

This is a speculative fix for a crash in `UpdateDraggableRegions` that we've noticed

* Update atom_api_browser_window_mac.mm

* Update atom_api_browser_window_mac.mm
This commit is contained in:
Samuel Attard 2020-01-29 16:55:27 -08:00 committed by GitHub
parent 2a47300d61
commit e528029345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,9 @@ void BrowserWindow::UpdateDraggableRegions(
if (window_->has_frame()) if (window_->has_frame())
return; return;
if (!web_contents())
return;
// All ControlRegionViews should be added as children of the WebContentsView, // All ControlRegionViews should be added as children of the WebContentsView,
// because WebContentsView will be removed and re-added when entering and // because WebContentsView will be removed and re-added when entering and
// leaving fullscreen mode. // leaving fullscreen mode.