fix: crash on missing render frame (#31289)

This commit is contained in:
Shelley Vohr 2021-10-07 07:26:18 +02:00 committed by GitHub
parent 014ebbd6fa
commit 9c8bd18c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);