This commit is contained in:
WBHarry 2025-11-15 16:34:54 +01:00
parent d113ddce74
commit 75510f2797
2 changed files with 8 additions and 5 deletions

View file

@ -363,7 +363,7 @@ export const typeConfig = {
{
key: 'system.linkedClass',
label: 'Class',
format: linkedClass => linkedClass.name
format: linkedClass => linkedClass?.name ?? game.i18n.localize('DAGGERHEART.UI.ItemBrowser.missing')
},
{
key: 'system.spellcastingTrait',
@ -375,10 +375,12 @@ export const typeConfig = {
key: 'system.linkedClass.uuid',
label: 'Class',
choices: items => {
const list = items.map(item => ({
value: item.system.linkedClass.uuid,
label: item.system.linkedClass.name
}));
const list = items
.filter(item => item.system.linkedClass)
.map(item => ({
value: item.system.linkedClass.uuid,
label: item.system.linkedClass.name
}));
return list.reduce((a, c) => {
if (!a.find(i => i.value === c.value)) a.push(c);
return a;