Commit 274dc97c authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Avoid DCHECK when the AXSelection base and/or extent are invalid.

Bug: 1013183
Change-Id: I15fc977a86773fca393a6ebd9ab09a1d52ab2934
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1853125
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704780}
parent d66030f8
......@@ -156,6 +156,9 @@ AXSelection AXSelection::FromCurrentSelection(
*ax_text_control, static_cast<int>(text_control.selectionEnd()),
extent_affinity);
if (!ax_base.IsValid() || !ax_extent.IsValid())
return {};
AXSelection::Builder selection_builder;
selection_builder.SetBase(ax_base).SetExtent(ax_extent);
return selection_builder.Build();
......
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