Return error to client on wrong type for HMGET

This commit is contained in:
Pieter Noordhuis
2010-10-26 12:26:27 +02:00
parent 244201f6ba
commit e584d82fec
2 changed files with 6 additions and 0 deletions

View File

@ -310,6 +310,7 @@ void hmgetCommand(redisClient *c) {
o = lookupKeyRead(c->db,c->argv[1]);
if (o != NULL && o->type != REDIS_HASH) {
addReply(c,shared.wrongtypeerr);
return;
}
/* Note the check for o != NULL happens inside the loop. This is