Fixed so missing statuses doesn't cause crashes

This commit is contained in:
WBHarry 2025-08-13 18:45:52 +02:00
parent 72edef0a04
commit 3721f9ee3f
2 changed files with 9 additions and 7 deletions

View file

@ -20,12 +20,14 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
for (var status of effect.statuses) {
if (!currentStatusActiveEffects.find(x => x.statuses.has(status))) {
const statusData = statusMap.get(status);
acc.push({
name: game.i18n.localize(statusData.name),
statuses: [status],
img: statusData.icon,
tint: effect.tint
});
if (statusData) {
acc.push({
name: game.i18n.localize(statusData.name),
statuses: [status],
img: statusData.icon,
tint: effect.tint
});
}
}
}