fixed issue where events page would error out if log was not already created.

This commit is contained in:
Julian Lam
2014-03-11 11:26:06 -04:00
parent 8873963946
commit de6f58842b

View File

@@ -88,7 +88,13 @@ var fs = require('fs'),
events.getLog = function(callback) {
var logFile = path.join(nconf.get('base_dir'), logFileName);
fs.readFile(logFile, callback);
fs.exists(logFile, function(exists) {
if (exists) {
fs.readFile(logFile, callback);
} else {
callback(null, 'No logs found');
}
});
}
}(module.exports));