Skip to content

Commit

Permalink
Bypass missing .cachebust
Browse files Browse the repository at this point in the history
  • Loading branch information
pilwon committed Oct 2, 2013
1 parent 0e2cd42 commit 7f9b7d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/server/middleware/cachebust.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ function _getHash(cb) {
}
fs.readFile(path.join(_app.dir, '../.cachebust'), 'utf8', function (err, data) {
_fileRead = true;
if (err) { return cb(err); }
try {
_cachebusts = JSON.parse(data);
} catch (e) {}
if (err) {
console.error(err.message);
} else {
try {
_cachebusts = JSON.parse(data);
} catch (e) {}
}
return cb(null, _cachebusts);
});
}
Expand Down

0 comments on commit 7f9b7d5

Please sign in to comment.