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' \