Skip to content

Commit

Permalink
fix: remove CHECK_EQ for swapped RFH (#30820)
Browse files Browse the repository at this point in the history
|old_host| may be nullptr if the previous RFH was shutdown.
  • Loading branch information
samuelmaddock committed Sep 3, 2021
1 parent c0da647 commit 9799589
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_web_contents.cc
Expand Up @@ -1421,12 +1421,11 @@ void WebContents::RenderFrameHostChanged(content::RenderFrameHost* old_host,
// If an instance of WebFrameMain exists, it will need to have its RFH
// swapped as well.
//
// |old_host| can be a nullptr in so we use |new_host| for looking up the
// |old_host| can be a nullptr so we use |new_host| for looking up the
// WebFrameMain instance.
auto* web_frame =
WebFrameMain::FromFrameTreeNodeId(new_host->GetFrameTreeNodeId());
if (web_frame) {
CHECK_EQ(web_frame->render_frame_host(), old_host);
web_frame->UpdateRenderFrameHost(new_host);
}
}
Expand Down

0 comments on commit 9799589

Please sign in to comment.