Larkinabout / fvtt-token-action-hud-core

Token Action HUD is a repositionable HUD of actions for a selected token.
13 stars 18 forks source link

[BUG] Error when updating compendiums #198

Closed dineshm72 closed 11 months ago

dineshm72 commented 11 months ago

Describe the bug When I am updating compendiums I sometimes get the following error:

TypeError: Error thrown in hooked function '' for hook 'updateCompendium'. Cannot read properties of null (reading 'includes') at CompendiumActionHandler.isLinkedCompendium (compendium-action-handler.js:92:29) at handleHookEvent (init.js:151:76) at Object.fn (init.js:123:52) at #call (foundry.js:730:20) at Hooks.callAll (foundry.js:687:17) at CompendiumCollection._onModifyContents (foundry.js:16703:11) at CompendiumCollection._onCreateDocuments (foundry.js:16658:10) at #handleCreateDocuments (foundry.js:13503:21)

I have seen this error thrown both when using the right click "Export to Compendium" feature (to export scenes to a shared compendium), and when using DDB Import to import things from D&D Beyond. It's not clear to me why TAH would need to be hooked for these activities, so I tried disabling TAH and rerunning these operations and they complete without errors.

Similar errors in other modules have been resolved by including more null checking.

Steps to reproduce Not easily reproducible, but I have noticed it when exporting scenes to a compendium using the Export to Compendium function. It may be related to exporting scenes that have various validation issues on them or have tokens not connected to actors, or other similar issues where normal fields have null values.

Versions:

Additional context Any additional context.

dineshm72 commented 11 months ago

related issue logged with Mr Primate. https://discord.com/channels/759781688011522069/761196953232211998/1149791821560545402

Larkinabout commented 11 months ago

Hopefully fixed in Token Action HUD Core 1.4.19.