From 0eada4b810eb90b0d1a0f2af6f5ef8357d501ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kov=C3=A1=C5=99?= Date: Mon, 15 Jan 2024 15:05:25 +0100 Subject: [PATCH] fix: prevent crash when _admin do not exists --- lib/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/index.ts b/lib/index.ts index d82b27b..990bdf2 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -357,6 +357,9 @@ const registerVerboseListeners = ( ); socket.conn.on("upgrade", (transport: any) => { + if (!socket.data._admin) { + socket.data._admin = {}; + } socket.data._admin.transport = transport.name; adminNamespace.emit("socket_updated", { id: socket.id,