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 069b5ca..2480e22 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;
 }