Skip to content

Node.js based forum software built for the modern web

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

Julian Lamde6f58842ba5
diff --git a/src/events.js b/src/events.js
index 825db1c832..57b61c8aeb 100644
--- a/src/events.js
+++ b/src/events.js
@@ -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));
\ No newline at end of file