mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
browser: fix null pointer dereference with getWebPreferences api (#12245)
* add failing spec * devtools webContents don't have associated webPreferences
This commit is contained in:
@@ -1768,6 +1768,8 @@ void WebContents::OnGetZoomLevel(IPC::Message* reply_msg) {
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user