From b82f6ab30531ee677dc6a4c94707c7a88cf42112 Mon Sep 17 00:00:00 2001 From: Sven Balzer <4653051+Kyuusokuna@users.noreply.github.com> Date: Thu, 1 May 2025 10:12:59 +0200 Subject: [PATCH] guard against not having flags on the chat message --- src/main.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.mjs b/src/main.mjs index cd78a3b..e1d356e 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -152,8 +152,8 @@ class DSA41_ChatMessage extends ChatMessage { const sender = html.querySelector(".message-sender"); sender?.replaceChildren(header); - if (this.flags.dsa41.type === "trefferpunkte" && this.flags.dsa41.targets.length != 0) { - const targets = this.flags.dsa41.targets.map(x => fromUuidSync(x, { strict: false })).filter(x => x !== null); + if (this.flags.dsa41?.type === "trefferpunkte" && this.flags.dsa41?.targets?.length != 0) { + const targets = this.flags.dsa41?.targets.map(x => fromUuidSync(x, { strict: false })).filter(x => x !== null); const targets_list = await instantiateTemplate("TrefferpunkteTargets", targets); html.querySelector(".message-content")?.appendChild(targets_list);