minor fix: prevent SpecialAbilitySheet to not render by introducing a sane fallback

main
macniel 2026-07-29 11:19:44 +02:00
parent 5b57546e25
commit 20d3a04577
1 changed files with 1 additions and 1 deletions

View File

@ -302,7 +302,7 @@ export class SpecialAbilitySheet extends HandlebarsApplicationMixin(DocumentShee
_onRender(context, options) { _onRender(context, options) {
if (this._selectedVariant == null) { if (this._selectedVariant == null) {
this._selectedVariant = this.document.system.auswahl[0].name this._selectedVariant = this.document.system.auswahl[0]?.name ?? ""
this._currentSelectedVariant = this.document.system.auswahl?.find(p => p.name === this._selectedVariant) this._currentSelectedVariant = this.document.system.auswahl?.find(p => p.name === this._selectedVariant)
this._currentSelectedVariantIndex = this.document.system.auswahl?.findIndex(p => p.name === this._selectedVariant) this._currentSelectedVariantIndex = this.document.system.auswahl?.findIndex(p => p.name === this._selectedVariant)
} }