1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Fixed zero length multibulk. Passing null not an empty array

This commit is contained in:
Tj Holowaychuk
2010-09-17 16:47:46 -07:00
parent c7d28bc601
commit a84c217827
2 changed files with 2 additions and 2 deletions

View File

@@ -118,7 +118,7 @@ RedisReplyParser.prototype.execute = function (incoming_buf) {
this.multi_bulk_replies = []; this.multi_bulk_replies = [];
this.state = "type"; this.state = "type";
if (0 == this.multi_bulk_length) { if (0 == this.multi_bulk_length) {
this.send_reply([]); this.send_reply(null);
} }
} else { } else {
this.emit("error", new Error("didn't see LF after NL reading multi bulk count")); this.emit("error", new Error("didn't see LF after NL reading multi bulk count"));

View File

@@ -218,7 +218,7 @@ tests.MULTIBULK_ZERO_LENGTH = function () {
var name = "MULTIBULK_ZERO_LENGTH"; var name = "MULTIBULK_ZERO_LENGTH";
client.KEYS(['users:*'], function(err, results){ client.KEYS(['users:*'], function(err, results){
assert.strictEqual(null, err, 'error on empty multibulk reply'); assert.strictEqual(null, err, 'error on empty multibulk reply');
assert.strictEqual(0, results.length); assert.strictEqual(null, results);
next(name); next(name);
}); });
}; };