Skip to content

Commit f5fa95e

Browse files
committed
fix: prevent unnecessary operations when client is not connected
1 parent 0004c1c commit f5fa95e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/controllers/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ const addClient = (
313313
clientConnections: Map<String, SenderFunction>
314314
) => {
315315
const disconnect = () => {
316+
if (!clientConnections.has(clientId)) return;
316317
clientConnections.delete(clientId);
317318
const clients = hosts.get(hostId);
318319
if (!clients || clients.size === 0) {

0 commit comments

Comments
 (0)