Fixes crash caused by NativeWindow::IsWebViewFocused.

The RenderViewHostView could be NULL when the renderer process has
crashed.

Fixes #206.
This commit is contained in:
Cheng Zhao 2014-03-10 09:24:51 +08:00
parent 3260b42b18
commit 337e9f9553

View file

@ -231,7 +231,9 @@ void NativeWindow::BlurWebView() {
} }
bool NativeWindow::IsWebViewFocused() { 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) { bool NativeWindow::SetIcon(const std::string& str_path) {