There was an error while loading. Please reload this page.
1 parent 8057543 commit 20eb2fcCopy full SHA for 20eb2fc
1 file changed
scripts/entities/helpers.js
@@ -238,7 +238,14 @@ export class SR5_EntityHelpers {
238
}
239
240
arrayTerms.sort((a, b) => {
241
- return game.i18n.localize(SR5[table][a.key]).localeCompare(game.i18n.localize(SR5[table][b.key]));
+ const labelA = SR5[table][a.key];
242
+ const labelB = SR5[table][b.key];
243
+ if (!labelA || !labelB) {
244
+ if (!labelA) SR5_SystemHelpers.srLog(1, `Missing key '${a.key}' in translation table '${table}'`);
245
+ if (!labelB) SR5_SystemHelpers.srLog(1, `Missing key '${b.key}' in translation table '${table}'`);
246
+ return 0;
247
+ }
248
+ return game.i18n.localize(labelA).localeCompare(game.i18n.localize(labelB));
249
});
250
for (let loop = 0; loop < arrayTerms.length; ++loop) {
251
newObject[arrayTerms[loop]["key"]] = arrayTerms[loop];
0 commit comments