mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Null check metadata (#1145)
* Null check metadata * Fix d20RollDialog action find --------- Co-authored-by: Chris Ryan <chrisr@blackhole> Co-authored-by: Dapoolp <elcatnet@gmail.com>
This commit is contained in:
parent
55586c93c8
commit
f1b5c80a53
2 changed files with 2 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
this.action =
|
||||
config.data.attack?._id == config.source.action
|
||||
? config.data.attack
|
||||
: this.item.system.actions.get(config.source.action);
|
||||
: this.item.system.actionsList?.find(a => a.id === config.source.action);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ export default class CostField extends fields.ArrayField {
|
|||
static calcCosts(costs) {
|
||||
const resources = CostField.getResources.call(this, costs);
|
||||
let filteredCosts = costs;
|
||||
if (this.parent.metadata.isQuantifiable && this.parent.consumeOnUse === false) {
|
||||
if (this.parent?.metadata.isQuantifiable && this.parent.consumeOnUse === false) {
|
||||
filteredCosts = filteredCosts.filter(c => c.key !== 'quantity');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue