Skip to content

Commit 986eb49

Browse files
committed
dgram: fix unhandled exception aborting a closed udp socket
Fixes: #46750
1 parent fda0de4 commit 986eb49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dgram.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function Socket(type, listener) {
139139
const { signal } = options;
140140
validateAbortSignal(signal, 'options.signal');
141141
const onAborted = () => {
142-
this.close();
142+
if (this[kStateSymbol].handle) this.close();
143143
};
144144
if (signal.aborted) {
145145
onAborted();

0 commit comments

Comments
 (0)