fix: possible exception if function is called early

Massimo Melina committed May 14, 2023 at 21:18 UTC ce5dc44ec72590eabf72ed20b0acffaaa69dc5f1
1 file changed +1 -1
src/listen.ts
+1 -1
@@ -40,7 +40,7 @@ portCfg.sub(async port => {
40
41 export function openAdmin() {
42 for (const srv of [httpSrv, httpsSrv]) {
43 - const a = srv.address()
43 + const a = srv?.address()
44 if (!a || typeof a === 'string') continue
45 const baseUrl = srv.name + '://localhost:' + a.port
46 open(baseUrl + ADMIN_URI, { wait: true}).catch(e => {