Fixed a lot of cases where we expected a combatant to have an attached actor (#1520)

This commit is contained in:
WBHarry 2026-01-10 00:21:44 +01:00 committed by GitHub
parent e6973fabd0
commit 0b343c9f52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 41 additions and 17 deletions

View file

@ -127,7 +127,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
resource,
active: index === combat.turn,
canPing: combatant.sceneId === canvas.scene?.id && game.user.hasPermission('PING_CANVAS'),
type: combatant.actor.system.type,
type: combatant.actor?.system?.type,
img: await this._getCombatantThumbnail(combatant)
};
@ -165,7 +165,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
if (this.viewed.turn !== toggleTurn) {
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
if (combatant.actor.type === 'character') {
if (combatant.actor?.type === 'character') {
await updateCountdowns(
CONFIG.DH.GENERAL.countdownProgressionTypes.spotlight.id,
CONFIG.DH.GENERAL.countdownProgressionTypes.characterSpotlight.id