From c06e4183b6e6e8103f1e2d2f829b11a32bc8cc61 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 22 Sep 2019 12:25:48 +0100 Subject: [PATCH] Check the length of the text in textarea --- webinterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webinterface.py b/webinterface.py index b023fb6b9..01fbd4e29 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1384,7 +1384,7 @@ def cursorToEndOfMessageScript() -> str: 'function focusOnMessage() {\n' \ " var replyTextArea = document.getElementById('message');\n" \ ' val = replyTextArea.value;\n' \ - ' if (val.charAt(val.length-1) != " ") {\n' \ + ' if (val.length>0) && (val.charAt(val.length-1) != " ") {\n' \ ' val += " ";\n' \ ' }\n' \ ' replyTextArea.focus();\n' \