1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Handle undefined redis_version

Apparently some servers don't send the redis_version with the INFO command (*cough* redis cloud *cough*). This causes the app to crash violently (yay node!).
This commit is contained in:
Robert Sköld
2014-02-17 13:26:16 +01:00
parent f6019658e6
commit 0367a64bff

View File

@@ -378,9 +378,11 @@ RedisClient.prototype.on_info_cmd = function (err, res) {
}); });
obj.versions = []; obj.versions = [];
obj.redis_version.split('.').forEach(function (num) { if( obj.redis_version ){
obj.versions.push(+num); obj.redis_version.split('.').forEach(function (num) {
}); obj.versions.push(+num);
});
}
// expose info key/vals to users // expose info key/vals to users
this.server_info = obj; this.server_info = obj;