Skip to content

Commit

Permalink
don't die if there are not stats, fixes 3rd-Eden#5
Browse files Browse the repository at this point in the history
  • Loading branch information
3rd-Eden committed Apr 6, 2012
1 parent e1efb6d commit b3f7387
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/memcached.js
Expand Up @@ -467,7 +467,7 @@ Client.config = {

// Fill the object
resultSet.forEach(function each (statSet) {
response[statSet[0]] = statSet[1];
if (statSet) response[statSet[0]] = statSet[1];
});

return response;
Expand All @@ -487,10 +487,12 @@ Client.config = {

// Fill the object
resultSet.forEach(function each (statSet) {
var identifier = statSet[0].split(':');
if (statSet) {
var identifier = statSet[0].split(':');

if (!response[identifier[0]]) response[identifier[0]] = {};
response[identifier[0]][identifier[1]] = statSet[1];
if (!response[identifier[0]]) response[identifier[0]] = {};
response[identifier[0]][identifier[1]] = statSet[1];
}
});

return response;
Expand All @@ -504,10 +506,12 @@ Client.config = {

// Fill the object
resultSet.forEach(function each (statSet) {
var identifier = statSet[0].split(':');
if (statSet) {
var identifier = statSet[0].split(':');

if (!response[identifier[1]]) response[identifier[1]] = {};
response[identifier[1]][identifier[2]] = statSet[1];
if (!response[identifier[1]]) response[identifier[1]] = {};
response[identifier[1]][identifier[2]] = statSet[1];
}
});

return response;
Expand Down

0 comments on commit b3f7387

Please sign in to comment.