mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-04 19:41:16 +01:00
fixed issue where events page would error out if log was not already created.
This commit is contained in:
@@ -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));
|
||||
Reference in New Issue
Block a user