Handle exceptions in chat mode's validate_username

This commit is contained in:
Micah Lee 2024-03-07 19:51:32 -08:00
parent fe7bd43f04
commit 3ef52eb59b
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -48,6 +48,7 @@ class ChatModeWeb:
self.define_routes()
def validate_username(self, username):
try:
username = username.strip()
return (
username
@ -55,6 +56,9 @@ class ChatModeWeb:
and username not in self.connected_users
and len(username) < 128
)
except Exception as e:
self.common.log("ChatModeWeb", "validate_username", e)
return False
def define_routes(self):
"""