fix no faction war submit 500
parent
a7412af2ef
commit
4d72a7d02f
|
@ -82,7 +82,6 @@ wars.route('/')
|
|||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
//TODO: combine run and clean in one script, so log file gets touched only once
|
||||
exec(__dirname + '/../war-parser/run.sh ' + folderName + ' ' + war._id, (error, stdout) => {
|
||||
if (error) {
|
||||
return next(error);
|
||||
|
@ -93,7 +92,9 @@ wars.route('/')
|
|||
}
|
||||
let obj = JSON.parse(`${stdout}`);
|
||||
for (let i = 0; i < obj.length; i++) {
|
||||
if (obj[i].fraction === 'BLUFOR') {
|
||||
if (!obj[i].fraction) {
|
||||
obj.splice(i, 1);
|
||||
} else if (obj[i].fraction === 'BLUFOR') {
|
||||
war.playersBlufor++;
|
||||
} else {
|
||||
war.playersOpfor++;
|
||||
|
|
Loading…
Reference in New Issue