From 4ea84f42aa569e1bc80dedd69d0fbb978c9bb12b Mon Sep 17 00:00:00 2001 From: liukun Date: Thu, 12 Dec 2019 08:21:51 +0800 Subject: [PATCH] Ignore empty hosts returned by CLUSTER SLOTS --- lib/cluster/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/cluster/index.ts b/lib/cluster/index.ts index 39c97680..c26fd28d 100644 --- a/lib/cluster/index.ts +++ b/lib/cluster/index.ts @@ -776,6 +776,9 @@ class Cluster extends EventEmitter { const keys = []; for (let j = 2; j < items.length; j++) { + if (!items[j][0]) { + continue; + } items[j] = this.natMapper({ host: items[j][0], port: items[j][1] }); items[j].readOnly = j !== 2; nodes.push(items[j]);