From a126ba0feeea8c36d3d4b78fed8f560dc60ef105 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Tue, 9 Jul 2024 02:45:25 -0400 Subject: [PATCH] Add userset length --- src/ws/Socket.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ws/Socket.ts b/src/ws/Socket.ts index a13c0fe..f942023 100644 --- a/src/ws/Socket.ts +++ b/src/ws/Socket.ts @@ -356,6 +356,9 @@ export class Socket extends EventEmitter { typeof color === "string" && !!color.match(/^#[0-9a-f]{6}$/i); } + if (typeof name !== "string") return; + if (name.length > 40) return; + await updateUser(this._id, { name: typeof name == "string" ? name : undefined, color: color && isColor ? color : undefined