Show notification when invalid item types are added to actors

This commit is contained in:
Carlos Fernandez 2026-04-15 21:40:22 -04:00
parent 7d5cdeb09d
commit 76a3268cf3
10 changed files with 41 additions and 25 deletions

View file

@ -31,11 +31,12 @@ export default class AncestrySheet extends DHHeritageSheet {
if (data.type === 'ActiveEffect') return super._onDrop(event);
const target = event.target.closest('fieldset.drop-section');
const typeField =
this.document.system[target.dataset.type === 'primary' ? 'primaryFeature' : 'secondaryFeature'];
if (!typeField) {
super._onDrop(event);
if (target) {
const typeField =
this.document.system[target.dataset.type === 'primary' ? 'primaryFeature' : 'secondaryFeature'];
if (!typeField) {
super._onDrop(event);
}
}
}
}