mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: return early on promise rejection (#26112)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
This commit is contained in:
@@ -868,9 +868,11 @@ v8::Local<v8::Promise> Session::ListWordsInSpellCheckerDictionary() {
|
||||
SpellcheckService* spellcheck =
|
||||
SpellcheckServiceFactory::GetForContext(browser_context_);
|
||||
|
||||
if (!spellcheck)
|
||||
if (!spellcheck) {
|
||||
promise.RejectWithErrorMessage(
|
||||
"Spellcheck in unexpected state: failed to load custom dictionary.");
|
||||
return handle;
|
||||
}
|
||||
|
||||
if (spellcheck->GetCustomDictionary()->IsLoaded()) {
|
||||
promise.Resolve(spellcheck->GetCustomDictionary()->GetWords());
|
||||
|
||||
Reference in New Issue
Block a user