Merge branch 'master' into 050-basic-active-effects

This commit is contained in:
Johannes Loher 2021-02-11 12:10:14 +01:00
commit ac84d40528
7 changed files with 131 additions and 80 deletions

View file

@ -91,8 +91,12 @@ export class DS4ItemSheet extends ItemSheet<ItemSheet.Data<DS4Item>> {
case "create":
return this._createActiveEffect();
case "edit":
const effect = this.item.effects.get(li.data("effectId"));
return effect?.sheet.render(true);
const id = li.data("effectId");
const effect = this.item.effects.get(id);
if (!effect) {
throw new Error(game.i18n.format("DS4.ErrorItemDoesNotHaveEffect", { id, item: this.item.name }));
}
return effect.sheet.render(true);
case "delete": {
return this.item.deleteEmbeddedEntity("ActiveEffect", li.data("effectId"));
}