From 2022aede9218d2fe7668115a75fa56032f863014 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Tue, 2 Mar 2021 14:55:43 +0100 Subject: [PATCH] Return early on promise reject. --- build/lib/i18n.js | 1 + build/lib/i18n.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 258fe1cd056..50ec3f3f45a 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -242,6 +242,7 @@ XLF.parse = function (xlfString) { } if (!key) { reject(new Error(`XLF parsing error: trans-unit ${JSON.stringify(unit, undefined, 0)} defined in file ${originalFilePath} is missing the ID attribute.`)); + return; } messages[key] = decodeEntities(val); }); diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 7d41c9ae3f9..746c481b262 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -344,6 +344,7 @@ export class XLF { } if (!key) { reject(new Error(`XLF parsing error: trans-unit ${JSON.stringify(unit, undefined, 0)} defined in file ${originalFilePath} is missing the ID attribute.`)); + return; } messages[key] = decodeEntities(val); });