Skip to content

Commit

Permalink
fix: crash on missing render frame (#31335)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Oct 11, 2021
1 parent 1caf4e6 commit f0b3784
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shell/browser/api/electron_api_web_contents.cc
Expand Up @@ -1679,6 +1679,9 @@ void WebContents::MessageTo(bool internal,
gin::Handle<WebFrameMain> web_frame_main =
WebFrameMain::From(JavascriptEnvironment::GetIsolate(), frame);

if (!web_frame_main->CheckRenderFrame())
return;

int32_t sender_id = ID();
web_frame_main->GetRendererApi()->Message(internal, channel,
std::move(arguments), sender_id);
Expand Down

0 comments on commit f0b3784

Please sign in to comment.