diff --git a/lib/server/socketHandlers/closeHandler.ts b/lib/server/socketHandlers/closeHandler.ts index fa3b28129..1859006b5 100644 --- a/lib/server/socketHandlers/closeHandler.ts +++ b/lib/server/socketHandlers/closeHandler.ts @@ -25,7 +25,7 @@ export const handleConnectionCloseOnSocket = ( closeReason, maskedToken, hashedToken, - remainingConnectionsCount: clientPool.length, + remainingConnectionsCount: clientPool?.length || 0, }, 'client connection closed', );