Prune missing party members (#1285)

This commit is contained in:
Carlos Fernandez 2025-11-15 05:51:34 -08:00 committed by GitHub
parent bdbca0d35a
commit 97ddf651a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -15,6 +15,9 @@ export default class ForeignDocumentUUIDArrayField extends foundry.data.fields.A
/** @inheritdoc */
initialize(value, model, options = {}) {
const v = super.initialize(value, model, options);
return () => v.map(entry => (typeof entry === 'function' ? entry() : entry));
return () => {
const data = v.map(entry => (typeof entry === 'function' ? entry() : entry));
return this.options.prune ? data.filter((d) => !!d) : d;
};
}
}