]> khamidou — GitHub mirrors - electron.git/commitdiff
nativeWindowMac: check for web_contents before clipping
authordeepak1556 <hop2deep@gmail.com>
Mon, 6 Apr 2015 09:52:26 +0000 (15:22 +0530)
committerdeepak1556 <hop2deep@gmail.com>
Mon, 6 Apr 2015 09:52:26 +0000 (15:22 +0530)
atom/browser/native_window_mac.mm

index 069b5cadef0fd863193ae2dfc12a46392d23b985..2480e22fb165f8fa455b2dafd0fde8e5cc02d95b 100644 (file)
@@ -820,7 +820,10 @@ void NativeWindowMac::UninstallView() {
 }
 
 void NativeWindowMac::ClipWebView() {
-  NSView* webView = GetWebContents()->GetNativeView();
+  content::WebContents* web_contents = GetWebContents();
+  if (!web_contents)
+    return;
+  NSView* webView = web_contents->GetNativeView();
   webView.layer.masksToBounds = YES;
   webView.layer.cornerRadius = kAtomWindowCornerRadius;
 }