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

v1.18.x
Julian Lam 11 years ago
parent 8873963946
commit de6f58842b

@ -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));
Loading…
Cancel
Save