Commit 4c089930 authored by Bruce Long's avatar Bruce Long Committed by Commit Bot

Windows Spellcheck: Fix crash seen in test code with delay init

A crash in several interactive_ui_tests is seen if the feature flags
WinUseBrowserSpellChecker and kWinDelaySpellcheckServiceInitfeature
are set to be on by default. Fix is just to follow the same pattern
used in other SpellCheckHostChromeImpl methods and do an early
return if the SpellcheckService is null.

Bug: 1118185
Change-Id: I785cd8cec37f42080acedb968b4a6671b01d2378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363871
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799562}
parent 3b705a74
...@@ -243,6 +243,13 @@ void SpellCheckHostChromeImpl::OnDictionariesInitialized() { ...@@ -243,6 +243,13 @@ void SpellCheckHostChromeImpl::OnDictionariesInitialized() {
DCHECK(dictionaries_loaded_callback_); DCHECK(dictionaries_loaded_callback_);
SpellcheckService* spellcheck = GetSpellcheckService(); SpellcheckService* spellcheck = GetSpellcheckService();
if (!spellcheck) { // Teardown.
std::move(dictionaries_loaded_callback_)
.Run(/*dictionaries=*/{}, /*custom_words=*/{},
/*enable=*/false);
return;
}
const bool enable = spellcheck->IsSpellcheckEnabled(); const bool enable = spellcheck->IsSpellcheckEnabled();
std::vector<spellcheck::mojom::SpellCheckBDictLanguagePtr> dictionaries; std::vector<spellcheck::mojom::SpellCheckBDictLanguagePtr> dictionaries;
......
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