diff --git a/src/cluster.c b/src/cluster.c index 9de90fe5b55ad05ec1568ade4645dc0d0085e6ca..7ef74f3637ea335ef1221227d46e39b02ddeb89f 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1669,8 +1669,11 @@ void clusterCommand(redisClient *c) { /* CLUSTER SETSLOT NODE */ clusterNode *n = clusterLookupNode(c->argv[4]->ptr); - if (!n) addReplyErrorFormat(c,"Unknown node %s", - (char*)c->argv[4]->ptr); + if (!n) { + addReplyErrorFormat(c,"Unknown node %s", + (char*)c->argv[4]->ptr); + return; + } /* If this hash slot was served by 'myself' before to switch * make sure there are no longer local keys for this hash slot. */ if (server.cluster->slots[slot] == server.cluster->myself &&