fix crash if getFileCompressed fails (i.e. if /static/js is called)

This commit is contained in:
Matthias Bartelmeß 2012-04-03 20:42:02 +02:00
parent 8be52df515
commit 7fbcffb30b
1 changed files with 4 additions and 1 deletions

View File

@ -131,7 +131,10 @@ exports.minify = function(req, res, next)
res.end();
} else if (req.method == 'GET') {
getFileCompressed(filename, contentType, function (error, content) {
if(ERR(error)) return;
if(ERR(error, function(){
res.writeHead(500, {});
res.end();
})) return;
res.header("Content-Type", contentType);
res.writeHead(200, {});
res.write(content);