Fix: aucune oeuvre connu

La fenêtre de jet se comporte correctement si le personnage
ne connait pas d'oeuvre
This commit is contained in:
2025-12-13 00:49:41 +01:00
parent 97cb730ab5
commit d6a492eef2
4 changed files with 20 additions and 10 deletions

View File

@@ -76,7 +76,7 @@ export class RollPartOeuvre extends RollPartSelect {
async _onRender(rollDialog, context, options) {
const selectOeuvre = rollDialog.element.querySelector(`roll-section[name="${this.code}"] select[name="select-oeuvre"]`)
selectOeuvre.addEventListener("change", e => {
selectOeuvre?.addEventListener("change", e => {
const selectOptions = e.currentTarget.options
const index = selectOptions.selectedIndex
this.$selectOeuvre(rollDialog.rollData, selectOptions[index]?.value)

View File

@@ -10,7 +10,10 @@ export class RollTypeOeuvre extends RollType {
visible(rollData) { return rollData.active.actor.isPersonnage() }
title(rollData) {
const current = rollData.current[PART_OEUVRE]
return `${current.art.action} ${current.label}`
if (current.art) {
return `${current.art.action} ${current.label}`
}
return 'interprête une oeuvre'
}
onSelect(rollData) {