Skip to content

Commit

Permalink
Don't let connection count go below 0 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Oct 9, 2024
1 parent 37d2d58 commit 28f4059
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/ServerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ export class ServerManager implements IServerManager {
return 0;
}

const connectionCount = serverState.connectionCount + incrementOrDecrement;
const connectionCount = Math.max(
0,
serverState.connectionCount + incrementOrDecrement
);

this._serverMap.set(serverUrl, {
...serverState,
Expand Down

0 comments on commit 28f4059

Please sign in to comment.