Commit eb1f48e5 authored by Robert Lord's avatar Robert Lord Committed by Commit Bot

[fuchsia] Check if InputEvent is null in IME's DidUpdateState

DidUpdateState can be null if there is no key associated with a state
update. In these cases, since we only care about extracting the keypress
associated with edits, we can just ignore the DidUpdateState call and
return early.

Change-Id: I5a6ce0a5ef13b8afad89abf6dab3eaf39167e74a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1573083
Commit-Queue: Robert Lord <lard@google.com>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652376}
parent c1dec1c5
......@@ -89,6 +89,13 @@ void InputMethodFuchsia::OnBlur() {
void InputMethodFuchsia::DidUpdateState(
fuchsia::ui::input::TextInputState state,
std::unique_ptr<fuchsia::ui::input::InputEvent> input_event) {
// The FIDL protocol for DidUpdateState allows it to be null, and so we may
// receive state updates that have no associated key. Since we're only
// interested in extracting out input events from this stream for now, we can
// just ignore state updates with no input event.
if (!input_event)
return;
if (input_event->is_keyboard())
event_converter_.ProcessEvent(*input_event);
else
......
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