Commit 9f56f8e6 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

[Autocorrect] add IsAvailable check before clearing

Bug: 1117498
Change-Id: I09c348442df6a23143c1bbdadbf1f5ecbb1add0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362239
Commit-Queue: My Nguyen <myy@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799463}
parent 70b526a5
......@@ -1779,6 +1779,11 @@ WebTextInputType InputMethodController::TextInputType() const {
void InputMethodController::WillChangeFocus() {
FinishComposingText(kKeepSelection);
// Event handler might destroy document.
if (!IsAvailable())
return;
GetDocument().Markers().RemoveSuggestionMarkerByType(
SuggestionMarker::SuggestionType::kAutocorrect);
}
......
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