From 1c6188cda8bfcb063a8ee605d83411abbf11ec4e Mon Sep 17 00:00:00 2001 From: psitacus Date: Wed, 9 Jul 2025 00:35:22 -0600 Subject: [PATCH] remove spurious defenses --- module/applications/sheets/items/armor.mjs | 6 +++--- module/applications/sheets/items/weapon.mjs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/applications/sheets/items/armor.mjs b/module/applications/sheets/items/armor.mjs index 48ebfd9a..912f88c2 100644 --- a/module/applications/sheets/items/armor.mjs +++ b/module/applications/sheets/items/armor.mjs @@ -56,7 +56,7 @@ export default class ArmorSheet extends DHBaseItemSheet { context.features = this.document.system.features.map(x => x.value); break; case 'attachments': - const attachedUUIDs = this.document.system.attached || []; + const attachedUUIDs = this.document.system.attached; context.attachedItems = await Promise.all( attachedUUIDs.map(async uuid => { const item = await fromUuid(uuid); @@ -97,7 +97,7 @@ export default class ArmorSheet extends DHBaseItemSheet { const item = await Item.implementation.fromDropData(data); if (!item) return; - const currentAttached = this.document.system.attached || []; + const currentAttached = this.document.system.attached; const newUUID = item.uuid; if (currentAttached.includes(newUUID)) { @@ -147,7 +147,7 @@ export default class ArmorSheet extends DHBaseItemSheet { */ static async #removeAttachment(event, target) { const uuid = target.dataset.uuid; - const currentAttached = this.document.system.attached || []; + const currentAttached = this.document.system.attached; await this.document.update({ 'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid) diff --git a/module/applications/sheets/items/weapon.mjs b/module/applications/sheets/items/weapon.mjs index e7347f30..d8ae35e0 100644 --- a/module/applications/sheets/items/weapon.mjs +++ b/module/applications/sheets/items/weapon.mjs @@ -57,7 +57,7 @@ export default class WeaponSheet extends DHBaseItemSheet { context.systemFields.attack.fields = this.document.system.attack.schema.fields; break; case 'attachments': - const attachedUUIDs = this.document.system.attached || []; + const attachedUUIDs = this.document.system.attached; context.attachedItems = await Promise.all( attachedUUIDs.map(async uuid => { const item = await fromUuid(uuid); @@ -97,7 +97,7 @@ export default class WeaponSheet extends DHBaseItemSheet { const item = await Item.implementation.fromDropData(data); if (!item) return; - const currentAttached = this.document.system.attached || []; + const currentAttached = this.document.system.attached; const newUUID = item.uuid; if (currentAttached.includes(newUUID)) { @@ -131,7 +131,7 @@ export default class WeaponSheet extends DHBaseItemSheet { */ static async #removeAttachment(event, target) { const uuid = target.dataset.uuid; - const currentAttached = this.document.system.attached || []; + const currentAttached = this.document.system.attached; await this.document.update({ 'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid)