summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/t_stream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index 38b59a067..82c926b39 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -976,8 +976,8 @@ void xreadCommand(client *c) {
"XREADGROUP. You called XREAD instead.");
return;
}
- groupname = c->argv[i]->ptr;
- consumername = c->argv[i+1]->ptr;
+ groupname = c->argv[i+1]->ptr;
+ consumername = c->argv[i+2]->ptr;
i += 2;
} else {
addReply(c,shared.syntaxerr);
@@ -1147,6 +1147,7 @@ void streamFreeCG(streamCG *cg) {
/* Lookup the consumer group in the specified stream and returns its
* pointer, otherwise if there is no such group, NULL is returned. */
streamCG *streamLookupCG(stream *s, sds groupname) {
+ if (s->cgroups == NULL) return NULL;
streamCG *cg = raxFind(s->cgroups,(unsigned char*)groupname,
sdslen(groupname));
return (cg == raxNotFound) ? NULL : cg;