Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

[BUG] Unhandled null in updateCombat hook, Turn Marker not removed from previous combatant when switching to a tokenless combatant. #23

@BoltsJ

Description

@BoltsJ

Describe the bug
In the hook for updateCombat starting at line 62 in turnmarker.js, an exception is thrown if a combatant has no token associated with it.

Environment Details
Foundry VTT Version: 0.7.5
Turn Marker Version: 2.6.9

To Reproduce
Steps to reproduce the behavior:

  1. Set up a combat
  2. run game.combat.addCombatant({ name: "DUMMY" });
  3. Move the turn to the dummy combatant.
  4. An uncaught exception is logged and the turn marker is not removed from the previous combatant until the next switch.

Expected behavior
The turn marker should be removed from the previous token, even if the next combatant has no token.

Screenshots
image

Additional context
I ran into this while developing a module that modifies the initiative behavior, but this occurs with no modules as well.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions