minor changes

This commit is contained in:
Sagie Gur-Ari 2015-08-27 16:46:25 +03:00
parent b040925f87
commit 4b04d1bd5a

View File

@ -1244,7 +1244,7 @@ cache(function (data, match, sendBadge, request) {
var apiUrl = 'https://api.npmjs.org/downloads/range/1000-01-01:3000-01-01/' + pkg; // use huge range, will need to fix this in year 3000 :)
var badgeData = getBadgeData('downloads', data);
request(apiUrl, function (err, res, buffer) {
if (err != null) {
if (err) {
badgeData.text[1] = 'inaccessible';
sendBadge(format, badgeData);
return;