From c06de1e6bd364d47ba86a467edcf19a4c5acd9c6 Mon Sep 17 00:00:00 2001 From: Aisu Wata Date: Fri, 12 May 2023 00:29:21 -0300 Subject: [PATCH] hotfix on emtpy content: Was unable to open a certain chat without this --- public/script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/script.js b/public/script.js index 059a13351..cff9b4a37 100644 --- a/public/script.js +++ b/public/script.js @@ -1183,6 +1183,10 @@ function scrollChatToBottom() { function substituteParams(content, _name1, _name2) { _name1 = _name1 ?? name1; _name2 = _name2 ?? name2; + if (!content) { + console.warn("No content on substituteParams") + return '' + } content = content.replace(/{{user}}/gi, _name1); content = content.replace(/{{char}}/gi, _name2);