fix crash when using getWebPreferences api with devtools webContents (#12254)

This commit is contained in:
Robo 2018-03-14 11:19:22 +09:00 committed by Samuel Attard
parent e62349cffb
commit e741bc0577
2 changed files with 12 additions and 0 deletions

View file

@ -1820,6 +1820,8 @@ void WebContents::OnGetZoomLevel(content::RenderFrameHost* rfh,
v8::Local<v8::Value> WebContents::GetWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());
if (!web_preferences)
return v8::Null(isolate);
return mate::ConvertToV8(isolate, *web_preferences->web_preferences());
}