diff options
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r-- | ext/node/polyfills/http.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index b1a536113..40155d998 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1657,7 +1657,7 @@ export class ServerImpl extends EventEmitter { #httpConnections: Set<Deno.HttpConn> = new Set(); #listener?: Deno.Listener; - #addr: Deno.NetAddr; + #addr: Deno.NetAddr | null = null; #hasClosed = false; #server: Deno.HttpServer; #unref = false; @@ -1843,6 +1843,7 @@ export class ServerImpl extends EventEmitter { } address() { + if (this.#addr === null) return null; return { port: this.#addr.port, address: this.#addr.hostname, |