fix: ensure owner window valid (#27947)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2021-03-01 19:33:45 -05:00
committed by GitHub
parent aec412e35d
commit 0e714d19c5

View File

@@ -1109,7 +1109,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());
}