From d5d291e4b3385bd9cd83439df78d83020336d308 Mon Sep 17 00:00:00 2001 From: kraktus Date: Wed, 30 Oct 2024 20:19:31 +0100 Subject: [PATCH] Permalog: always convert reason to string before escaping to html https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent/reason `reason read-only property is any JavaScript value or Object which provides the reason passed into Promise.reject()` fix https://github.com/lichess-org/lila/issues/16295 --- ui/common/src/permalog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/common/src/permalog.ts b/ui/common/src/permalog.ts index 9ddca4515ddf2..a26a537dfaeaf 100644 --- a/ui/common/src/permalog.ts +++ b/ui/common/src/permalog.ts @@ -100,7 +100,7 @@ function makeLog(): LichessLog { log(`${terseHref()} - ${e.reason}`); if (site.debug) domDialog({ - htmlText: escapeHtml(e.reason), + htmlText: escapeHtml(e.reason.toString()), class: 'debug', show: true, });