Skip to content

Commit

Permalink
Check explicitly that license is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow authored and espadrine committed Apr 13, 2017
1 parent 1ae490a commit 59ec4a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4917,8 +4917,9 @@ cache(function(data, match, sendBadge, request) {
badgeData.colorscheme = vdata.color;
sendBadge(format, badgeData);
} else if (info === 'l') {
badgeData.text[0] = 'license';
var license = data.license;
if (license) {
if (Array.isArray(license) && license.length > 0) {
// API returns licenses inconsistently ordered, so fix the order.
badgeData.text[1] = license.sort().join(',');
badgeData.colorscheme = 'blue';
Expand Down

0 comments on commit 59ec4a4

Please sign in to comment.