diff --git a/rueidis.go b/rueidis.go index d96e9583..290cc70f 100644 --- a/rueidis.go +++ b/rueidis.go @@ -303,10 +303,9 @@ func NewClient(option ClientOption) (client Client, err error) { return newSingleClient(&option, nil, makeConn) } if client, err = newClusterClient(&option, makeConn); err != nil { - if client == nil || client == (*clusterClient)(nil) { + if client == (*clusterClient)(nil) { return nil, err } - if len(option.InitAddress) == 1 && (err.Error() == redisErrMsgCommandNotAllow || strings.Contains(strings.ToUpper(err.Error()), "CLUSTER")) { option.PipelineMultiplex = singleClientMultiplex(pmbk) client, err = newSingleClient(&option, client.(*clusterClient).single(), makeConn)