Activate strict mode

This commit is contained in:
Johannes Loher 2021-02-07 13:51:20 +01:00
parent 3c47b06f71
commit 09b4117306
9 changed files with 78 additions and 63 deletions

View file

@ -83,7 +83,7 @@ export class DS4ItemSheet extends ItemSheet<DS4Item> {
event.preventDefault();
if (this.item.isOwned) {
return ui.notifications.warn(game.i18n.localize("DS4.WarningManageActiveEffectOnOwnedItem"));
return ui.notifications?.warn(game.i18n.localize("DS4.WarningManageActiveEffectOnOwnedItem"));
}
const a = event.currentTarget;
const li = $(a).parents(".effect");
@ -93,7 +93,7 @@ export class DS4ItemSheet extends ItemSheet<DS4Item> {
return this._createActiveEffect();
case "edit":
const effect = this.item.effects.get(li.data("effectId"));
return effect.sheet.render(true);
return effect?.sheet.render(true);
case "delete": {
return this.item.deleteEmbeddedEntity("ActiveEffect", li.data("effectId"));
}