Browse Source

fix: ensure owner window valid (#27948)

Co-authored-by: Shelley Vohr <[email protected]>
trop[bot] 4 years ago
parent
commit
e262b5040a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      shell/browser/api/electron_api_base_window.cc

+ 1 - 1
shell/browser/api/electron_api_base_window.cc

@@ -1105,7 +1105,7 @@ void BaseWindow::ResetBrowserViews() {
       // reset if the owner window is *this* window.
       if (browser_view->web_contents()) {
         auto* owner_window = browser_view->web_contents()->owner_window();
-        if (owner_window == window_.get()) {
+        if (owner_window && owner_window == window_.get()) {
           browser_view->web_contents()->SetOwnerWindow(nullptr);
           owner_window->RemoveBrowserView(browser_view->view());
         }