Skip to content

Commit

Permalink
dgram: fix unhandled exception aborting a closed udp socket
Browse files Browse the repository at this point in the history
Fixes: #46750
  • Loading branch information
vramana committed Feb 22, 2023
1 parent fda0de4 commit 986eb49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Socket(type, listener) {
const { signal } = options;
validateAbortSignal(signal, 'options.signal');
const onAborted = () => {
this.close();
if (this[kStateSymbol].handle) this.close();
};
if (signal.aborted) {
onAborted();
Expand Down

0 comments on commit 986eb49

Please sign in to comment.