warrior's gift will still show name if no template

This commit is contained in:
2024-06-11 09:08:31 -05:00
parent 18cd705626
commit 94ee4243fa
+7 -1
View File
@@ -6,7 +6,13 @@ export class WarriorsGiftEffect extends PowerEffect {
constructor(token, targets) { constructor(token, targets) {
super(token, targets); super(token, targets);
const template = game.actors.getName('warriors-edge_template'); 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() { get name() {