Skip to content

Commit 0e2a475

Browse files
VoltrexKeyvaaduh95
andcommitted
dgram: use missing validator
We don't mention a value being "falsy" in validation, its better to use a validator here to keep consistency. fixup! dgram: use missing validator Updated the validation to be more strict. Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 663d7e9 commit 0e2a475

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/dgram.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ Socket.prototype.send = function(buffer,
636636
if (typeof address === 'function') {
637637
callback = address;
638638
address = undefined;
639-
} else if (address && typeof address !== 'string') {
640-
throw new ERR_INVALID_ARG_TYPE('address', ['string', 'falsy'], address);
639+
} else if (address != null) {
640+
validateString(address, 'address');
641641
}
642642

643643
healthCheck(this);

0 commit comments

Comments
 (0)