Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 64f5bde

Browse files
MarshallOfSoundsamuelmaddock
authored andcommitted
fix: crash in WebFrameMain mojo connection when RenderFrameHost is nullptr (electron#34411)
* fix: crash when RenderFrameHost is nullptr * chore: lint fix Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
1 parent c9e8e84 commit 64f5bde

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

shell/browser/api/electron_api_web_frame_main.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,13 @@ void WebFrameMain::MaybeSetupMojoConnection() {
193193
renderer_api_.set_disconnect_handler(base::BindOnce(
194194
&WebFrameMain::OnRendererConnectionError, weak_factory_.GetWeakPtr()));
195195
}
196+
197+
// Render frame should exist when this method is called.
198+
DCHECK(render_frame_);
199+
196200
// Wait for RenderFrame to be created in renderer before accessing remote.
197-
if (pending_receiver_ && render_frame_->IsRenderFrameCreated()) {
201+
if (pending_receiver_ && render_frame_ &&
202+
render_frame_->IsRenderFrameCreated()) {
198203
render_frame_->GetRemoteInterfaces()->GetInterface(
199204
std::move(pending_receiver_));
200205
}

0 commit comments

Comments
 (0)