Add null check for error callback on missions update

This commit is contained in:
Björn Dahlgren 2018-08-18 16:34:01 +02:00
parent 0d6e66e131
commit 5880b10b24

View File

@ -27,7 +27,9 @@ Missions.prototype.updateMissions = function (cb) {
var self = this
fs.readdir(this.missionsPath(), function (err, files) {
if (err) {
cb(err)
if (cb) {
cb(err)
}
} else {
async.map(files, function (filename, cb) {
fs.stat(self.missionPath(filename), function (err, stat) {