Fix CefFrame::GetSource crash on detached frame (fixes issue #2898)

This commit is contained in:
Andrei Kurushin 2020-04-02 21:01:33 +00:00 committed by Marshall Greenblatt
parent cf6b57d659
commit 01f385a6f7
1 changed files with 10 additions and 0 deletions

View File

@ -367,6 +367,11 @@ void CefFrameHostImpl::SendCommand(
if (frame_id < CefFrameHostImpl::kMainFrameId)
return;
if (!render_frame_host_ || !response_manager_) {
// detached frame has no response_manager_
return;
}
TRACE_EVENT2("cef", "CefFrameHostImpl::SendCommand", "frame_id", frame_id,
"needsResponse", responseHandler.get() ? 1 : 0);
Cef_Request_Params params;
@ -407,6 +412,11 @@ void CefFrameHostImpl::SendCode(
if (frame_id < CefFrameHostImpl::kMainFrameId)
return;
if (!render_frame_host_ || !response_manager_) {
// detached frame has no response_manager_
return;
}
TRACE_EVENT2("cef", "CefFrameHostImpl::SendCommand", "frame_id", frame_id,
"needsResponse", responseHandler.get() ? 1 : 0);
Cef_Request_Params params;