Return early on promise reject.
This commit is contained in:
parent
ed1118b27b
commit
2022aede92
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue