From 56ea03023412e16da56488f748a94f9b60b703e0 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Tue, 13 May 2025 16:35:41 -0400 Subject: [PATCH] fix: make udp4 default more resilient If 'type' was not specified in an object argument to the constructor of UDPSocket, it would result in an undefined value. This is probably not what the user intended and it always results in an exception being thrown. --- server/udp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/udp.js b/server/udp.js index 7cbd1df..346fe17 100644 --- a/server/udp.js +++ b/server/udp.js @@ -10,7 +10,7 @@ class Server extends udp.Socket { constructor(options) { let type = 'udp4'; if (typeof options === 'object') { - type = options.type; + type = options.type ?? type; } super(type); if (typeof options === 'function') {