ghost-fvtt / fxmaster

A module for Foundry Virtual Tabletop that adds various special effects.
Other
18 stars 13 forks source link

Module stops working after no effect is applied for a scene #792

Open marvin-nerlich opened 1 month ago

marvin-nerlich commented 1 month ago

Expected Behavior

Module work properly and doesn't break a scene when no effect applied after a effect was applied.

Current Behavior

Module works, but if an effect was applied to a scene and was deactivated after, Foundry won't draw primary canvas and therefore stops working. Error:

Error: Failed drawing primary canvas group: Cannot read properties of null (reading 'type'). Cannot read properties of null (reading 'type') [Detected 1 package: fxmaster(4.1.0)] at Hooks.onError (foundry.js:658:24) at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54) at #draw (foundry.js:25057:15) at async Canvas.draw (foundry.js:24941:5) at async Scene.view (foundry.js:21362:7)

Steps to Reproduce

  1. Import fvtt-Scene-swamp_-the-magician-tower-1hW4NpTk9cHczB6a2.json as scene.
  2. Apply any weather effect
  3. Uncheck the applied weather effect
  4. Restart/reload Foundry
  5. Go to the imported scene and receive the error shown above

Context

First off: Yes, I know that the module is currently working for Foundry V12 but it seems to work for me and maybe the error helps with troubleshooting.

I checked the .json file of the scene and found the following code block:

    "fxmaster": {
      "effects": {
        "-=0": null
      },
      "invert": false
    },

After deleting the block or the contents of the block and reloading Foundry, everything works fine again.

Version

4.1.0

Foundry VTT Version

12.329

Operating System

Windows

Browser / App

Chrome

Game System

dnde5

Relevant Modules

No response