Commit 3639bf0c authored by W. James MacLean's avatar W. James MacLean Committed by Commit Bot

Speculative mitigation for crash in DispatchTouchEvent().

From the stack traces for this bug, it looks like we're trying to access
an optional value that isn't set. While we investigate why this is
happening, let's explicitly check the value exists before accessing.

Bug: 888143
Change-Id: Ifc1e47cc26e601c450f70b07dc37e764f6543802
Reviewed-on: https://chromium-review.googlesource.com/1240129Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593629}
parent 56f2089b
......@@ -730,9 +730,12 @@ void RenderWidgetHostInputEventRouter::DispatchTouchEvent(
// of the touch sequence, though this could be wrong; a better approach
// might be to always transform each point to the |touch_target_.target|
// for the duration of the sequence.
DCHECK(target_location.has_value());
touch_target_.delta =
target_location.value() - touch_event.touches[0].PositionInWidget();
if (target_location.has_value()) {
touch_target_.delta =
target_location.value() - touch_event.touches[0].PositionInWidget();
} else {
touch_target_.delta = gfx::Vector2dF();
}
DCHECK(touchscreen_gesture_target_map_.find(
touch_event.unique_touch_event_id) ==
......
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