Guard against null window like before
This commit is contained in:
parent
c60a9d242e
commit
dc5221d551
1 changed files with 5 additions and 3 deletions
|
@ -194,9 +194,11 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
|
||||||
auto embedder = manager->GetEmbedder(guest_instance_id);
|
auto embedder = manager->GetEmbedder(guest_instance_id);
|
||||||
if (embedder) {
|
if (embedder) {
|
||||||
auto window = NativeWindow::FromWebContents(embedder);
|
auto window = NativeWindow::FromWebContents(embedder);
|
||||||
const bool visible = window->IsVisible() && !window->IsMinimized();
|
if (window) {
|
||||||
if (!visible) {
|
const bool visible = window->IsVisible() && !window->IsMinimized();
|
||||||
command_line->AppendSwitch(switches::kHiddenPage);
|
if (!visible) {
|
||||||
|
command_line->AppendSwitch(switches::kHiddenPage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue