Исправлены ошибки на пограничных условиях
This commit is contained in:
parent
6524701fc5
commit
eb2976ad47
2 changed files with 9 additions and 2 deletions
|
|
@ -64,7 +64,7 @@ export class UsersService {
|
|||
},
|
||||
limit: 1,
|
||||
});
|
||||
if (!res && !res.docs && !res.docs[0]) {
|
||||
if (!res || !res.docs || !res.docs[0]) {
|
||||
return null;
|
||||
}
|
||||
const userFromDb = res.docs[0];
|
||||
|
|
|
|||
|
|
@ -141,6 +141,10 @@ export namespace DailyEccmReport {
|
|||
private issuesService: IssuesService,
|
||||
) {
|
||||
const users: Models.UserReport[] = this.eccmUsers.map((user) => {
|
||||
if (!user) {
|
||||
this.logger.error(`Not found user data`);
|
||||
return;
|
||||
}
|
||||
const u: Models.User = {
|
||||
id: user.id,
|
||||
lastname: user.lastname,
|
||||
|
|
@ -151,7 +155,7 @@ export namespace DailyEccmReport {
|
|||
activities: [],
|
||||
issuesGroupedByStatus: [],
|
||||
} as Models.UserReport;
|
||||
});
|
||||
}).filter((user) => Boolean(user));
|
||||
this.report = {
|
||||
byUsers: users,
|
||||
params: {
|
||||
|
|
@ -456,6 +460,9 @@ export class DailyEccmReportService {
|
|||
this.logger.debug(`Loaded data for uniq issues - count = ${issues.length}`);
|
||||
const issuesMap: Record<number, RedmineTypes.Issue> = {};
|
||||
issues.forEach((issue) => {
|
||||
if (!issue || !issue.fixed_version) {
|
||||
return;
|
||||
}
|
||||
const version = issue.fixed_version.name;
|
||||
if (this.eccmConfig.currentVersions.includes(version)) {
|
||||
issuesMap[issue.id] = issue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue