From d79a8ef40f5670af6962b598752dc5a7aa96722c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=86?= Date: Wed, 25 Dec 2019 12:11:23 +0800 Subject: [PATCH] fix: ignore empty hosts returned by CLUSTER SLOTS (#1025) --- 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]);