Fixed not being able to open the tokenConfig of actor-less tokens

This commit is contained in:
WBHarry 2026-02-11 00:31:45 +01:00
parent a65514b1c1
commit 17ec77a349

View file

@ -6,7 +6,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
const valueGroup = game.i18n.localize('TOKEN.BarValues'); const valueGroup = game.i18n.localize('TOKEN.BarValues');
const actorModel = typeKey ? game.system.api.data.actors[`Dh${typeKey.capitalize()}`] : null; const actorModel = typeKey ? game.system.api.data.actors[`Dh${typeKey.capitalize()}`] : null;
const getLabel = path => { const getLabel = path => {
const label = actorModel.schema.getField(path)?.label; const label = actorModel?.schema.getField(path)?.label;
return label ? game.i18n.localize(label) : path; return label ? game.i18n.localize(label) : path;
}; };