From dc5221d551ba8d526776adcd07a9b8429e8fa373 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 6 Jun 2017 17:02:23 -0700 Subject: [PATCH] Guard against null window like before --- atom/browser/web_contents_preferences.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 30213b098fde..b2d8bc50855d 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -194,9 +194,11 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches( auto embedder = manager->GetEmbedder(guest_instance_id); if (embedder) { auto window = NativeWindow::FromWebContents(embedder); - const bool visible = window->IsVisible() && !window->IsMinimized(); - if (!visible) { - command_line->AppendSwitch(switches::kHiddenPage); + if (window) { + const bool visible = window->IsVisible() && !window->IsMinimized(); + if (!visible) { + command_line->AppendSwitch(switches::kHiddenPage); + } } } }