kristianserrano / swade-item-tables-issue-tracker

Report an issue with the SWADE Item Tables module for Foundry VTT
0 stars 1 forks source link

Can't add item with invalid item grant #16

Open mhilbrunner opened 2 weeks ago

mhilbrunner commented 2 weeks ago

Turns out I had a item (an edge) that had an item link with a broken reference/link/UUID, so it shows up as a red in the item sheet. A player tried to add that edge for a advance, which silently added the item to the character without generating a advance. This error occurs in the console:

 TypeError: Cannot read properties of null (reading 'handleChoices')
[Detected 2 packages: system:swade(4.1.1), swade-item-tables(1.21.9)]
    at SwadeItem.getItemGrantChain (SwadeItem.ts:640:39)
    at async SwadeItem.grantEmbedded (SwadeItem.ts:582:24)
    at async SwadeItem._onCreateOperation (SwadeItem.ts:880:11)
    at async #handleCreateDocuments (foundry-esm.js:56450:7)
    at async SwadeItem.createDocuments (foundry-esm.js:11423:23)
    at async CharacterBuilder._onDropAdvanceItem (CharacterBuilder.mjs:1262:38)

Either the item shouldn't be added or a advance should still be generated (probably the latter). In either case, IMO an error/warning should be shown.

kristianserrano commented 2 weeks ago

That looks like it's actually a bug in the SWADE system. SwadeItem is a class from the system itself.