forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
async-hooks,net: ensure asyncId=null if no handle
If the .listen() hasn't been called on the server, there is no handle object. In this case use null as the triggerAsyncId. Fixes: nodejs#13548
- Loading branch information
1 parent
f05653d
commit b68cc5c
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const net = require('net'); | ||
const server = net.createServer(); | ||
|
||
try { | ||
server.getConnections(() => { | ||
assert.ok(true, "No error thrown") | ||
}); | ||
} | ||
catch (e) { | ||
assert.ok(false, "getConnections threw an error"); | ||
} |