Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: crash in WebFrameMain mojo connection when RenderFrameHost is nullptr #34417

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion shell/browser/api/electron_api_web_frame_main.cc
Expand Up @@ -193,8 +193,13 @@ void WebFrameMain::MaybeSetupMojoConnection() {
renderer_api_.set_disconnect_handler(base::BindOnce(
&WebFrameMain::OnRendererConnectionError, weak_factory_.GetWeakPtr()));
}

// Render frame should exist when this method is called.
DCHECK(render_frame_);

// Wait for RenderFrame to be created in renderer before accessing remote.
if (pending_receiver_ && render_frame_->IsRenderFrameCreated()) {
if (pending_receiver_ && render_frame_ &&
render_frame_->IsRenderFrameCreated()) {
render_frame_->GetRemoteInterfaces()->GetInterface(
std::move(pending_receiver_));
}
Expand Down