Browse Source

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!).
gh-pages
Robert Sköld 11 years ago
parent
commit
0367a64bff
  1. 8
      index.js

8
index.js

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

Loading…
Cancel
Save