Skip to content

Commit

Permalink
fix: crash on missing render frame
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Oct 5, 2021
1 parent 4fd7c2a commit ed8ee5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions shell/browser/api/electron_api_web_contents.cc
Expand Up @@ -1697,9 +1697,14 @@ void WebContents::MessageTo(int32_t web_contents_id,
gin::Handle<WebFrameMain> web_frame_main =
WebFrameMain::From(JavascriptEnvironment::GetIsolate(), frame);

int32_t sender_id = ID();
web_frame_main->GetRendererApi()->Message(false /* internal */, channel,
std::move(arguments), sender_id);
if (!web_frame_main->CheckRenderFrame())
return;

if () {
int32_t sender_id = ID();
web_frame_main->GetRendererApi()->Message(
false /* internal */, channel, std::move(arguments), sender_id);
}
}
}

Expand Down

0 comments on commit ed8ee5e

Please sign in to comment.