fix: fix possible null property exception in examples
[poolifier.git] / examples / typescript / http-server-pool / fastify-cluster / src / worker.ts
index d70b76dd7f93f2d026126ef7b84b46504f2361bd..283a223e3438aa07af36343368d6dd03de05017e 100644 (file)
@@ -36,7 +36,7 @@ class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     await FastifyWorker.fastify.listen({ port })
     return {
       status: true,
-      port: (FastifyWorker.fastify.server.address() as AddressInfo).port
+      port: (FastifyWorker.fastify.server.address() as AddressInfo)?.port
     }
   }