From ab609f1eaa3b25d2b664a06473563f9d076d1acc Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Sun, 5 Nov 2023 06:30:05 -0500 Subject: [PATCH] Native rolls: Don't include custom damage type if empty When building damage formula, don't add the damage type if it's empty, otherwise it created `[]` which causes Foundry to crash. (untested) Fixes #1086 --- FVTT-module/beyond20/beyond20.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FVTT-module/beyond20/beyond20.js b/FVTT-module/beyond20/beyond20.js index e8746d2e..bd9e1b1c 100644 --- a/FVTT-module/beyond20/beyond20.js +++ b/FVTT-module/beyond20/beyond20.js @@ -361,7 +361,7 @@ class Beyond20 { for (let i = 0; i < request.damages.length; i++) { let type = (request['damage-types'][i] || "").trim(); // Add damage type in the flavor text for each damage - const damage = `(${request.damages[i]})[${type}]`; + const damage = type ? `(${request.damages[i]})[${type}]` : `${request.damages[i]}`; if (CONFIG.DND5E.damageTypes[type.toLowerCase()]) { type = type.toLowerCase(); } else {