Skip to content

Commit

Permalink
Bug 1788135 - Fix "Assertion failure: !IsDOMException()" when running…
Browse files Browse the repository at this point in the history
… with rr r=platform-i18n-reviewers,gregtatum

This only fixes the crash, not the root cause of the error.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1788135#c16

Differential Revision: https://phabricator.services.mozilla.com/D163833
  • Loading branch information
mb committed Dec 8, 2022
1 parent 196b6aa commit 0c14644
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dom/l10n/DOMLocalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ already_AddRefed<Promise> DOMLocalization::TranslateElements(

FormatMessagesSync(l10nKeys, l10nMessages, aRv);

if (NS_WARN_IF(aRv.Failed())) {
promise->MaybeRejectWithUndefined();
return MaybeWrapPromise(promise);
}

bool allTranslated =
ApplyTranslations(domElements, l10nMessages, aProto, aRv);
if (NS_WARN_IF(aRv.Failed()) || !allTranslated) {
Expand Down

0 comments on commit 0c14644

Please sign in to comment.