mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Merge pull request #122 from Dahlgren/bugfix/missions-error
Handle errors while loading missions list
This commit is contained in:
@ -27,14 +27,20 @@ Missions.prototype.updateMissions = function (cb) {
|
|||||||
var self = this
|
var self = this
|
||||||
fs.readdir(this.missionsPath(), function (err, files) {
|
fs.readdir(this.missionsPath(), function (err, files) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
console.log(err)
|
||||||
|
|
||||||
if (cb) {
|
if (cb) {
|
||||||
cb(err)
|
return cb(err)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
async.map(files, function (filename, cb) {
|
async.map(files, function (filename, cb) {
|
||||||
fs.stat(self.missionPath(filename), function (err, stat) {
|
fs.stat(self.missionPath(filename), function (err, stat) {
|
||||||
if (err) {
|
if (err) {
|
||||||
cb(err)
|
console.log(err)
|
||||||
|
return cb(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cb(null, {
|
cb(null, {
|
||||||
@ -55,7 +61,6 @@ Missions.prototype.updateMissions = function (cb) {
|
|||||||
cb(err, missions)
|
cb(err, missions)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user