Fix retrieving parent documents when the model is null (#1853)

This commit is contained in:
Carlos Fernandez 2026-05-01 17:00:03 -04:00 committed by GitHub
parent d0c2c783f1
commit c7159eff11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,6 +171,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
/** Recursively finds the first parent document of the given object */ /** Recursively finds the first parent document of the given object */
static #resolveParentDocument(model, documentClass) { static #resolveParentDocument(model, documentClass) {
if (!model) return null;
return model instanceof documentClass return model instanceof documentClass
? model ? model
: model.parent : model.parent