2690 - Duplicated foreign key fix
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-12-29 13:39:10 +01:00
parent e193c2998c
commit 20862db854
1 changed files with 8 additions and 2 deletions

View File

@ -146,8 +146,14 @@ module.exports = function(Self) {
function replaceErr(err, replaceErrFunc) {
if (Array.isArray(err)) {
let errs = [];
for (let e of err)
errs.push(replaceErrFunc(e));
const errors = err.filter(error => {
return error != undefined && error != null;
});
for (let e of errors) {
if (!(e instanceof UserError))
errs.push(replaceErrFunc(e));
else errs.push(e);
}
return errs;
}
return replaceErrFunc(err);