]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix a crash when creating window.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 11 Jul 2014 11:39:35 +0000 (19:39 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 11 Jul 2014 11:39:35 +0000 (19:39 +0800)
atom/browser/atom_browser_client.cc

index cbe5f5b8a536b37a5f9b3665cc9f75807f29692c..b62bc37b4b4e5271da6ef284bdc3516a90c3a1ac 100644 (file)
@@ -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_;
   }