From ad4daf0b00d080a96c9c81073f11fa392a8450fe Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Thu, 6 Aug 2026 08:14:06 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20exception=20si=20le=20dialogue=20d'appre?= =?UTF-8?q?ntissage=20est=20ferm=C3=A9=20pendant=20le=20jet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #getSpecialtyName accédait à this.#el sans garde : fermer le dialogue pendant l'animation du jet levait "Uncaught (in promise)". Chaînage optionnel sur l'élément (le jet se résout quand même et dépense le dé). --- module/system/dialogs/learningDialog.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/system/dialogs/learningDialog.mjs b/module/system/dialogs/learningDialog.mjs index 0acb372..9f641bc 100644 --- a/module/system/dialogs/learningDialog.mjs +++ b/module/system/dialogs/learningDialog.mjs @@ -182,7 +182,9 @@ export default class LearningDialog extends HandlebarsApplicationMixin(foundry.a } #getSpecialtyName() { - return this.#el.querySelector("#specialty-name")?.value?.trim() || game.i18n.localize("ITEMS.new_specialty"); + // Le dialogue peut avoir été fermé pendant le jet (this.#el null). + const el = this.#el?.querySelector("#specialty-name"); + return el?.value?.trim() || game.i18n.localize("ITEMS.new_specialty"); } #compute() {