You've already forked node-redis
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:
8
index.js
8
index.js
@@ -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;
|
||||||
|
Reference in New Issue
Block a user