Skip to content

Commit 025c65c

Browse files
author
Ruben Bridgewater
committed
Fix handling of missing info return value. Fixes #541
1 parent afcd760 commit 025c65c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Bugfixes:
1111

1212
- Fix argument mutation while using the array notation with the multi constructor (@BridgeAR)
1313
- Fix multi.hmset key not being type converted if used with an object and key not being a string (@BridgeAR)
14+
- Fix parser errors not being catched properly (@BridgeAR)
15+
- Fix a crash that could occur if a redis server does return the info command as usual #541 (@BridgeAR)
1416

1517
## v2.0.1 - Sep 24, 2015
1618

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,14 @@ RedisClient.prototype.on_info_cmd = function (err, res) {
343343
return;
344344
}
345345

346+
/* istanbul ignore if: some servers might not respond with any info data. This is just a safety check that is difficult to test */
347+
if (!res) {
348+
debug('The info command returned without any data.');
349+
this.server_info = {};
350+
this.on_ready();
351+
return;
352+
}
353+
346354
var self = this;
347355
var obj = {};
348356
var lines = res.toString().split("\r\n");

0 commit comments

Comments
 (0)