kgar / foundry-vtt-tidy-5e-sheets

D&D 5e sheet layouts for Foundry VTT, focused on a clean UI, user ergonomics, and extensibility.
https://kgar.github.io/foundry-vtt-tidy-5e-sheets/
MIT License
42 stars 14 forks source link

bug: Spell Atk / DC tooltips do not handle "None" Spellcasting Ability #266

Closed kgar closed 9 months ago

kgar commented 9 months ago

Account for there being no spellcasting ability. For now, simply interpret it as 0 (None), which while not even render on the sheet.

kgar commented 9 months ago

Some additional info from the community server:

https://discord.com/channels/1167985253072257115/1197799118341423158

jtsmirror OP — Today at 1:06 AM After opening some character sheets, an error occurs. I disabled all modules except for DnD Beyond and Tidy 5e. (It's worth noting that so far, the error has only appeared for me in character sheets converted by DnD Beyond, and only in some of them.)

Foundry VTT | Rendering Tidy5eNpcSheet logging.ts:37 tidy5e-sheet-kgar | An error occurred while calculating spell attack bonus TypeError: Cannot read properties of undefined (reading 'label') at calculateSpellAttackAndDc (formula.ts:132:62) at Tidy5eCharacterSheet.getData (Tidy5eCharacterSheet.ts:319:26) error @ logging.ts:37 calculateSpellAttackAndDc @ formula.ts:154 getData @ Tidy5eCharacterSheet.ts:319 await in getData (async) (anonymous) @ Tidy5eCharacterSheet.ts:61 subscribe2 @ index.js:84 Tidy5eCharacterSheet @ Tidy5eCharacterSheet.ts:60 get sheet @ foundry.js:14122 _onClickEntryName @ foundry.js:70219 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 Show 1 more frame Show less logging.ts:37 tidy5e-sheet-kgar | An error occurred while calculating spell attack bonus TypeError: Cannot read properties of undefined (reading 'label') at calculateSpellAttackAndDc (formula.ts:132:62) at Tidy5eCharacterSheet.getData (Tidy5eCharacterSheet.ts:319:26) at async Tidy5eCharacterSheet._render (Tidy5eCharacterSheet.ts:451:18) error @ logging.ts:37 calculateSpellAttackAndDc @ formula.ts:154 getData @ Tidy5eCharacterSheet.ts:319 await in getData (async) _render @ Tidy5eCharacterSheet.ts:451 await in _render (async) render @ foundry.js:5769 render @ foundry.js:7111 _onClickEntryName @ foundry.js:70219 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 foundry.js:5802 Foundry VTT | Rendering Tidy5eCharacterSheet logging.ts:37 tidy5e-sheet-kgar | An error occurred while calculating spell attack bonus TypeError: Cannot read properties of undefined (reading 'label') at calculateSpellAttackAndDc (formula.ts:132:62) at Tidy5eCharacterSheet.getData (Tidy5eCharacterSheet.ts:319:26) at async Tidy5eCharacterSheet._render (foundry.js:5812:18) at async Tidy5eCharacterSheet._render (foundry.js:6532:5) at async Tidy5eCharacterSheet._render (Tidy5eCharacterSheet.ts:457:13)

kgar commented 9 months ago

Closing as completed.