diff --git a/browser/native_window.cc b/browser/native_window.cc index e1f061d7955..bff1c2f3c77 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -231,7 +231,9 @@ void NativeWindow::BlurWebView() { } bool NativeWindow::IsWebViewFocused() { - return GetWebContents()->GetRenderViewHost()->GetView()->HasFocus(); + content::RenderWidgetHostView* host_view = + GetWebContents()->GetRenderViewHost()->GetView(); + return host_view && host_view->HasFocus(); } bool NativeWindow::SetIcon(const std::string& str_path) {