mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Chagned handlebarhelper rollparsed to be more defensive
This commit is contained in:
parent
d454234a75
commit
fdb7dc9867
1 changed files with 2 additions and 2 deletions
|
|
@ -60,7 +60,7 @@ export default class RegisterHandlebarsHelpers {
|
||||||
|
|
||||||
static rollParsed(value, actor, item, numerical) {
|
static rollParsed(value, actor, item, numerical) {
|
||||||
const isNumerical = typeof numerical === 'boolean' ? numerical : false;
|
const isNumerical = typeof numerical === 'boolean' ? numerical : false;
|
||||||
const result = itemAbleRollParse(value, actor.getRollData(), item);
|
const result = itemAbleRollParse(value, actor?.getRollData() ?? {}, item);
|
||||||
return isNumerical ? (!result ? 0 : Number(result)) : result;
|
return isNumerical ? (!result ? 0 : Number(result)) : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ export default class RegisterHandlebarsHelpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
static empty(object) {
|
static empty(object) {
|
||||||
if(!(typeof object === 'object')) return true;
|
if (!(typeof object === 'object')) return true;
|
||||||
return Object.keys(object).length === 0;
|
return Object.keys(object).length === 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue