Merge pull request #592 from fourplusone/fix_crash_minify_dir
fix crash if getFileCompressed fails (i.e. if /static/js is called)
This commit is contained in:
commit
49593a1c8e
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue