mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: ensure owner window valid (#27947)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user