Removing feature with provided spell breaks sheet

Issue #283 resolved
Ben Freeland created an issue

Setup

dnd5e: 1.4.1
obsidian: 5.0.16

Steps to Reproduce

  1. Create player sheet
  2. Create Feature and add Provides Spells effect and settings Individual Spells, Innate, and Charisma.
  3. Drag any spell from the spells compendium to the effect (eg. Awaken)
  4. Drag Feature onto player sheet
  5. Delete feature

Expected

Feature and spell are removed from sheet

Observed

Feature and spell are not removed from sheet and the following error is logged:

item.js:337 Uncaught (in promise) TypeError: Cannot read property 'type' of undefined
at spell (item.js:337)
at prepareData (item.js:150)
at Item5e.prepareObsidianEffects (item.js:60)
at actor.js:238
at Array.forEach (<anonymous>)
at ObsidianActor.prepareDerivedData (actor.js:238)
at ObsidianActor.prepareData (foundry.js:9318)
at ObsidianActor.prepareData (entity.js:55)
at ClientDatabaseBackend._handleDeleteEmbeddedDocuments (foundry.js:9032)
at ClientDatabaseBackend._deleteEmbeddedDocuments (foundry.js:8942)
spell @ item.js:337
prepareData @ item.js:150
Item5e.prepareObsidianEffects @ item.js:60
(anonymous) @ actor.js:238
prepareDerivedData @ actor.js:238
prepareData @ foundry.js:9318
prepareData @ entity.js:55
_handleDeleteEmbeddedDocuments @ foundry.js:9032
_deleteEmbeddedDocuments @ foundry.js:8942

Once this has happened if you close the sheet and try to open it again the following error occurs:

foundry.js:2006 TypeError: An error occurred while rendering ObsidianCharacter 60: Cannot read property 'forEach' of undefined
at ObsidianCharacter.getData (obsidian.js:201)
at ObsidianCharacter._render (foundry.js:2042)
at ObsidianCharacter._render (foundry.js:2729)
at ObsidianCharacter._render (obsidian.js:439)
at ObsidianCharacter.render (foundry.js:2004)
at ObsidianCharacter.render (foundry.js:3223)
at ObsidianCharacter.render (obsidian.js:225)
at ActorDirectory._onClickEntityName (foundry.js:23645)
at ActorDirectory._onClickEntityName (foundry.js:32052)
at HTMLOListElement.dispatch (jquery.min.js:2)
(anonymous) @ foundry.js:2006
Promise.catch (async)
render @ foundry.js:2004
render @ foundry.js:3223
render @ obsidian.js:225
_onClickEntityName @ foundry.js:23645
_onClickEntityName @ foundry.js:32052
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

Comments (1)

  1. Log in to comment