From c4da1e3576ec9ab01978ca451e309a71b61d339a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 3 Mar 2024 19:36:40 +0200 Subject: [PATCH] Fix for stats with no chat open --- public/scripts/stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/stats.js b/public/scripts/stats.js index 5a26a4905..48983766b 100644 --- a/public/scripts/stats.js +++ b/public/scripts/stats.js @@ -266,7 +266,7 @@ function countWords(str) { * @param {string} oldMesssage - The old message that's being processed. */ async function statMesProcess(line, type, characters, this_chid, oldMesssage) { - if (this_chid === undefined) { + if (this_chid === undefined || characters[this_chid] === undefined) { return; } await getStats();