You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the damage formula 1d10+@mod.strength for a monster's attack, then hit save, and found I wasn't able to open the monster's character sheet back up. I had to disable the mod, correct the bad formula, then re-enable the mod.
TypeError: right-hand side of 'in' should be an object, got number
[Detected 2 packages: monsterblock, system:dnd5e]
getProperty common/utils/helpers.mjs:295
replaceFormulaData scripts/foundry.js:7072
replaceFormulaData scripts/foundry.js:7071
parse scripts/foundry.js:7032
Roll scripts/foundry.js:6591
damageFormula modules/monsterblock/scripts/dnd5e/AttackPreper.js:251
formatAttackAndDamage modules/monsterblock/scripts/dnd5e/AttackPreper.js:189
getDamageData modules/monsterblock/scripts/dnd5e/AttackPreper.js:166
getAllDamageData modules/monsterblock/scripts/dnd5e/AttackPreper.js:148
getDescription modules/monsterblock/scripts/dnd5e/AttackPreper.js:53
prepare modules/monsterblock/scripts/dnd5e/AttackPreper.js:21
prepareItem modules/monsterblock/scripts/dnd5e/ItemPrep.js:123
organizeFeatures modules/monsterblock/scripts/dnd5e/ItemPrep.js:105
prepareItems modules/monsterblock/scripts/dnd5e/ItemPrep.js:62
ItemPrep modules/monsterblock/scripts/dnd5e/ItemPrep.js:36
_prepareItems modules/monsterblock/scripts/dnd5e/MonsterBlock5e.js:494
getData systems/dnd5e/module/actor/sheets/base.js:158
getData systems/dnd5e/module/actor/sheets/npc.js:78
getData modules/monsterblock/scripts/dnd5e/MonsterBlock5e.js:64
_render scripts/foundry.js:3062
_render scripts/foundry.js:3764
render scripts/foundry.js:3021
render scripts/foundry.js:4259
_onClickDocumentName scripts/foundry.js:47577
jQuery 2
foundry.js:319:30
The text was updated successfully, but these errors were encountered:
@zeel01 I looked into this one and it appears to be fixed in the latest stable version of foundry. The getProperty method (see below) seems to explicitly return undefined if the input key doesn't give an Object or Array type, which should prevent the error from occurring. Might want to confirm against an older version just to be certain, but I think this one can be closed.
if ( !key ) return undefined;
let target = object;
for ( let p of key.split('.') ) {
const t = getType(target);
if ( !((t === "Object") || (t === "Array")) ) return undefined;
if ( p in target ) target = target[p];
else return undefined;
}
return target;
}
I used the damage formula
1d10+@mod.strength
for a monster's attack, then hit save, and found I wasn't able to open the monster's character sheet back up. I had to disable the mod, correct the bad formula, then re-enable the mod.The text was updated successfully, but these errors were encountered: