Skip to content

Commit

Permalink
fix: crash on missing render frame (electron#31289)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and t57ser committed Oct 27, 2021
1 parent 9848659 commit 033de3d
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 @@ -1706,6 +1706,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 033de3d

Please sign in to comment.