p4535992 / conditional-visibility

a FoundryVTT module to hide tokens from some players, but not from others
MIT License
5 stars 8 forks source link

[BUG] enhanced_condition.js, CUB and Tidy5e - uncaught error in: 'if (!actor.effects.size) continue;' #50

Open DevConFox opened 2 years ago

DevConFox commented 2 years ago

Module Version: v0.6.16

Describe the bug AS GM, when updating the prototype token of a 'character' actor and no token is placed on the canvas, the "hasCondition" function throws an uncaught error at line 1429 'if (!actor.effects.size) continue;' due to entities in line 1405 being an array with one element of type 'undefined'.

To Reproduce Steps to reproduce the behavior:

  1. Set up "Exhaustion 1-5" in CUBlab for Tidy5e Sheet Exhaustion
  2. Open "Prototype Token"
  3. Press "Update Token"

Expected behavior Either check, if actor object exists in line 1429 or if element in entities array is not of type 'undefined' in line 1405

Browser:

Foundry Version: v9 Build 269

Game System: dnd5e v1.6.3

Additional context CUB v1.9.2 Tidy5e Sheet v0.5.33