Made sure a non-existant origin doesn't cause ActiveEffect application to break

This commit is contained in:
WBHarry 2026-05-01 11:30:41 +02:00
parent 20056cd950
commit 528985a993

View file

@ -185,7 +185,9 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
if (effect.origin) {
if (useOrigin) value = value.replaceAll(/origin\.@/gi, '@');
const originEffect = foundry.utils.fromUuidSync(effect.origin);
origin = this.#resolveParentDocument(originEffect, Item);
if (originEffect)
origin = this.#resolveParentDocument(originEffect, Item);
}
// Get the actor and item documents. Note that actor roll data is inclusive of system roll data