diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index 1e9c2fccc..51887f2b9 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -928,7 +928,8 @@ bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry, if (client_.get()) { CefRefPtr handler = client_->GetFocusHandler(); - if (handler.get() && !handler->OnSetFocus(this, false)) { + if (!handler.get() || + (handler.get() && !handler->OnSetFocus(this, false))) { // Restore focus to the main frame prior to loading new request. // This makes sure that we don't have a focused iframe. Otherwise, that // iframe would keep focus when the SetFocus called immediately after