From 94ee4243fae4091ba4167093ecbdb00c6a8d8f1b Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Tue, 11 Jun 2024 09:08:31 -0500 Subject: [PATCH] warrior's gift will still show name if no template --- src/module/powers/warriorsGift.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/module/powers/warriorsGift.js b/src/module/powers/warriorsGift.js index 03e589d..c3e6e27 100644 --- a/src/module/powers/warriorsGift.js +++ b/src/module/powers/warriorsGift.js @@ -6,7 +6,13 @@ export class WarriorsGiftEffect extends PowerEffect { constructor(token, targets) { super(token, targets); const template = game.actors.getName('warriors-edge_template'); - this.edges = template.items.filter((i) => i.type === 'edge').map((i) => template.getEmbeddedDocument('Item', i.id)); + if (template) { + this.edges = template.items + .filter((i) => i.type === 'edge') + .map((i) => template.getEmbeddedDocument('Item', i.id)); + } else { + this.edges = []; + } } get name() {