From b4ba14966297aca882e530ff4c5403f9dc888490 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 11 Jul 2014 19:39:35 +0800 Subject: [PATCH] Fix a crash when creating window. --- atom/browser/atom_browser_client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index cbe5f5b8..b62bc37b 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -26,6 +26,10 @@ struct FindByProcessId { } bool operator() (NativeWindow* const window) { + content::WebContents* web_contents = window->GetWebContents(); + if (!web_contents) + return false; + int id = window->GetWebContents()->GetRenderProcessHost()->GetID(); return id == child_process_id_; } -- 2.43.0