Commit f536a38d authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Don't crash in the case of an unexpected IPC response.

BUG=746967

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Id9106a040641386eea32988ce44cd2324e36798b
Reviewed-on: https://chromium-review.googlesource.com/684657Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504482}
parent 19e92b54
......@@ -2108,6 +2108,11 @@ void RenderFrameHostImpl::OnTextSurroundingSelectionResponse(
const base::string16& content,
uint32_t start_offset,
uint32_t end_offset) {
// text_surrounding_selection_callback_ should not be null, but don't trust
// the renderer.
if (text_surrounding_selection_callback_.is_null())
return;
// Just Run the callback instead of propagating further.
text_surrounding_selection_callback_.Run(content, start_offset, end_offset);
// Reset the callback for enabling early exit from future request.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment