Skip to content

Commit

Permalink
dgram: use simplified validator
Browse files Browse the repository at this point in the history
The `dgram` lib module should use the simplified `validatePort()`
validator.
  • Loading branch information
VoltrexKeyva committed Aug 13, 2021
1 parent 310ed47 commit baa5a2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
};

Socket.prototype.connect = function(port, address, callback) {
port = validatePort(port, 'Port', { allowZero: false });
port = validatePort(port, 'Port', false);
if (typeof address === 'function') {
callback = address;
address = '';
Expand Down Expand Up @@ -626,7 +626,7 @@ Socket.prototype.send = function(buffer,
}

if (!connected)
port = validatePort(port, 'Port', { allowZero: false });
port = validatePort(port, 'Port', false);

// Normalize callback so it's either a function or undefined but not anything
// else.
Expand Down

0 comments on commit baa5a2f

Please sign in to comment.