Skip to content

Commit 9316842

Browse files
authored
Merge pull request #974 from microsoft/benibenj/modest-dragonfly
Validate NLS strings
2 parents 093d33f + d3cc84c commit 9316842

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/nls.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ function createPatcher(translations: ITranslations): <T>(value: T) => T {
1818
return value;
1919
}
2020

21-
return ((translations[match[1]] as unknown) ?? value) as T;
21+
const translation = translations[match[1]] as unknown;
22+
if (translation === undefined) {
23+
throw new Error(`No translation found for ${value}`);
24+
}
25+
26+
return translation as T;
2227
};
2328
}
2429

0 commit comments

Comments
 (0)