Skip to content

Commit

Permalink
fix: ensure owner window valid (#27948)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Mar 4, 2021
1 parent e5eafc8 commit e262b50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_base_window.cc
Expand Up @@ -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());
}
Expand Down

0 comments on commit e262b50

Please sign in to comment.