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.
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.