From f890f0f133d4986a79d478a6a191be88a4a9af5c Mon Sep 17 00:00:00 2001 From: In3luki <41452412+In3luki@users.noreply.github.com> Date: Sun, 9 Nov 2025 00:52:52 +0100 Subject: [PATCH] Fix invalid item `Documents` preventing all physical item updates --- src/module/item/physical/helpers.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/module/item/physical/helpers.ts b/src/module/item/physical/helpers.ts index e68652b91ee..90ebd391349 100644 --- a/src/module/item/physical/helpers.ts +++ b/src/module/item/physical/helpers.ts @@ -270,7 +270,13 @@ function handleHPChange(item: PhysicalItemPF2e, changed: DeepPartial i._id === item._id); if (itemIndex === -1) return; actorSource?.items.splice(itemIndex ?? 0, 1, changedSource); - const actorClone = actorSource ? new ActorProxyPF2e(actorSource) : null; + const actorClone = ((): ActorPF2e | null => { + // Catch invalid items in the actor clone preventing other items from updating + try { + return actorSource ? new ActorProxyPF2e(actorSource) : null; + } catch {} + return null; + })(); const itemClone = actorClone?.inventory.get(item.id, { strict: true }) ?? item.clone(changed, { keepId: true }); // Adjust current HP proportionally if max HP changed