fix: return early on promise rejection (#26095)
This commit is contained in:
parent
c934d1386b
commit
d9db9873fd
1 changed files with 3 additions and 1 deletions
|
@ -978,9 +978,11 @@ v8::Local<v8::Promise> Session::ListWordsInSpellCheckerDictionary() {
|
||||||
SpellcheckService* spellcheck =
|
SpellcheckService* spellcheck =
|
||||||
SpellcheckServiceFactory::GetForContext(browser_context_);
|
SpellcheckServiceFactory::GetForContext(browser_context_);
|
||||||
|
|
||||||
if (!spellcheck)
|
if (!spellcheck) {
|
||||||
promise.RejectWithErrorMessage(
|
promise.RejectWithErrorMessage(
|
||||||
"Spellcheck in unexpected state: failed to load custom dictionary.");
|
"Spellcheck in unexpected state: failed to load custom dictionary.");
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
if (spellcheck->GetCustomDictionary()->IsLoaded()) {
|
if (spellcheck->GetCustomDictionary()->IsLoaded()) {
|
||||||
promise.Resolve(spellcheck->GetCustomDictionary()->GetWords());
|
promise.Resolve(spellcheck->GetCustomDictionary()->GetWords());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue