Avoid raising errors when fetchFromSvg fails

This commit is contained in:
Thaddee Tyl 2015-09-22 11:55:39 +02:00
parent b59cee7123
commit ad86099e1a

View File

@ -4445,6 +4445,7 @@ function fetchFromSvg(request, url, cb) {
try {
var badge = buffer.replace(/(?:\r\n\s*|\r\s*|\n\s*)/g, '');
var match = />([^<>]+)<\/text><\/g>/.exec(badge);
if (!match) { return cb(Error('Cannot fetch from SVG:\n' + buffer)); }
cb(null, match[1]);
} catch(e) {
cb(e);