Skip to content

Commit

Permalink
http: check if socket is null before destory
Browse files Browse the repository at this point in the history
  • Loading branch information
F3n67u committed Jul 12, 2022
1 parent ed7631d commit b17a007
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ Server.prototype.closeAllConnections = function() {
const connections = this[kConnections].all();

for (let i = 0, l = connections.length; i < l; i++) {
connections[i].socket.destroy();
connections[i].socket?.destroy();
}
};

Server.prototype.closeIdleConnections = function() {
const connections = this[kConnections].idle();

for (let i = 0, l = connections.length; i < l; i++) {
connections[i].socket.destroy();
connections[i].socket?.destroy();
}
};

Expand Down

0 comments on commit b17a007

Please sign in to comment.