diff --git a/packages/broker/src/adapters/deepkit-adapter.ts b/packages/broker/src/adapters/deepkit-adapter.ts index d76649e77..d73d2742e 100644 --- a/packages/broker/src/adapters/deepkit-adapter.ts +++ b/packages/broker/src/adapters/deepkit-adapter.ts @@ -110,7 +110,7 @@ export class BrokerDeepkitPool { getConnection(key: string): BrokerDeepkitConnection { //key is used for consistent hashing if (this.options.servers.length === 1) { - if (!this.connections) this.createConnection(this.options.servers[0]); + if (!this.connections.length) this.createConnection(this.options.servers[0]); return this.connections[0].connection; }