Skip to content

Commit 8d58de6

Browse files
committed
Fixed a CEF crash that occurred when using the application cache
(<html manifest="cache.appcache">)
1 parent 7aa4980 commit 8d58de6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

MTA10/core/CWebCore.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,12 @@ void CCefApp::OnRegisterCustomSchemes ( CefRefPtr < CefSchemeRegistrar > registr
797797

798798
CefRefPtr<CefResourceHandler> CCefApp::Create ( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& scheme_name, CefRefPtr<CefRequest> request )
799799
{
800+
// browser or frame are NULL if the request does not orginate from a browser window
801+
// This is for exmaple true for the application cache or CEFURLRequests
802+
// (http://www.html5rocks.com/en/tutorials/appcache/beginner/)
803+
if ( !browser || !frame )
804+
return nullptr;
805+
800806
CWebCore* pWebCore = static_cast<CWebCore*> ( g_pCore->GetWebCore () );
801807
auto pWebView = pWebCore->FindWebView ( browser );
802808
if ( !pWebView || !pWebView->IsLocal () )

0 commit comments

Comments
 (0)