diff --git a/module/actor/actor.js b/module/actor/actor.js index 98d8cdbd..f50f3f73 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -246,7 +246,7 @@ export class HeroSystem6eActor extends Actor { data.type != "pc" && data.system.characteristics.stun.value < -10 ) { - let combatant = game.combat.combatants.find( + const combatant = game.combat?.combatants.find( (o) => o.actorId === data._id, ); if (combatant && !combatant.defeated) { diff --git a/module/ruler.js b/module/ruler.js index f214920b..138169a8 100644 --- a/module/ruler.js +++ b/module/ruler.js @@ -90,10 +90,10 @@ export class HeroRuler { (automation === "pcEndOnly" && actor.type === "pc") ) { // Only consume endurance on token's phase, allowing for Knockback movement (which does not consume END) - if (game.combat.combatant.actorId != actor.id) + if (game.combat?.combatant.actorId != actor.id) continue; - let combatant = game.combat.combatants.find( + const combatant = game.combat?.combatants.find( (o) => o.actorId === actor.id, ); if (combatant) {