Browse Source

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

* 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

Co-authored-by: Samuel Attard <[email protected]>
trop[bot] 5 years ago
parent
commit
b6cb396893
1 changed files with 3 additions and 0 deletions
  1. 3 0
      shell/browser/api/atom_api_browser_window_mac.mm

+ 3 - 0
shell/browser/api/atom_api_browser_window_mac.mm

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