Skip to content

Commit

Permalink
fix: crash on missing render frame (#31334)
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 7, 2021
1 parent 9c54bf7 commit 3c47d9e
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 @@ -1727,6 +1727,9 @@ void WebContents::MessageTo(int32_t web_contents_id,
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(false /* internal */, channel,
std::move(arguments), sender_id);
Expand Down

0 comments on commit 3c47d9e

Please sign in to comment.