I'm trying to navigate to a html file and the HTTP request for an html was dying in CefLoadHandler::OnLoadError() with ERR_FAILED.
The problem was a crash here due to pBrowser->GetMainFrame() being null.
void CMyCefRenderProcessHandler::OnContextCreated(
CefRefPtr<CefBrowser> pBrowser,
CefRefPtr<CefFrame> pFrame,
CefRefPtr<CefV8Context> pContext) /*override*/
{
CEF_REQUIRE_RENDERER_THREAD();
pBrowser->GetMainFrame()->GetURL();
}
Adding an if (pBrowser->GetMainFrame()) check before the GetURL() call fixes the problem.
Is it a bug that the main frame can be null here? Or is it expected?
I never saw this with CEF 77. BTW, I'm using Windows 10 x64.