Cleanup style on #545's PR

This commit is contained in:
Thaddee Tyl 2015-12-05 23:42:06 +01:00
parent 92f2f322db
commit 5bc3fd64e3

View File

@ -4266,13 +4266,10 @@ cache(function(data, match, sendBadge, request) {
return;
}
try {
var data = JSON.parse(buffer);
// the data is formatted as an array
data = data[0];
// data.followers_count could be zero...don't just check if falsey
if(!data.hasOwnProperty('followers_count')){
badgeData.text[1] = '';
} else {
// The data is formatted as an array.
var data = JSON.parse(buffer)[0];
// data.followers_count could be zero… don't just check if falsey.
if (data.followers_count != null){
badgeData.text[1] = metric(data.followers_count);
}
} catch(e) {