mirror of
https://github.com/electron/electron.git
synced 2026-01-22 22:08:14 -05:00
Fix a crash issue in GetProcessOwner if no renderer view host is found.
This commit is contained in:
@@ -58,11 +58,15 @@ enum ProcessOwner {
|
||||
OWNER_GUEST_WEB_CONTENTS,
|
||||
OWNER_NONE, // it might be devtools though.
|
||||
};
|
||||
|
||||
ProcessOwner GetProcessOwner(int process_id,
|
||||
NativeWindow** window,
|
||||
WebViewManager::WebViewInfo* info) {
|
||||
auto web_contents = content::WebContents::FromRenderViewHost(
|
||||
content::RenderViewHost::FromID(process_id, kDefaultRoutingID));
|
||||
content::RenderViewHost* rvh = content::RenderViewHost::FromID(
|
||||
process_id, kDefaultRoutingID);
|
||||
if (!rvh)
|
||||
return OWNER_NONE;
|
||||
auto web_contents = content::WebContents::FromRenderViewHost(rvh);
|
||||
if (!web_contents)
|
||||
return OWNER_NONE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user