Fix null point exception for chart version (#16006)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2021-11-22 10:48:42 +08:00 committed by GitHub
parent 21dfba7330
commit 784cdabc61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -42,9 +42,6 @@ export class ProjectsComponent implements OnInit, OnDestroy {
currentFilteredType: number = 0; // all projects
projectName: string = "";
loading: boolean = true;
get selecteType(): string {
return this.currentFilteredType + "";
}
@ -82,7 +79,7 @@ export class ProjectsComponent implements OnInit, OnDestroy {
this.listProject.currentPage = 1;
this.listProject.searchKeyword = projectName;
this.listProject.selectedRow = [];
this.loading = true;
this.listProject.loading = true;
let passInFilteredType: number = undefined;
if (this.listProject.filteredType > 0) {
passInFilteredType = this.listProject.filteredType - 1;
@ -90,7 +87,7 @@ export class ProjectsComponent implements OnInit, OnDestroy {
return this.proService.listProjects( this.listProject.searchKeyword,
passInFilteredType, this.listProject.currentPage, this.listProject.pageSize, getSortingString(this.listProject.state))
.pipe(finalize(() => {
this.loading = false;
this.listProject.loading = false;
}));
})).subscribe(response => {
// Get total count

View File

@ -191,7 +191,7 @@ export class ChartVersionComponent implements OnInit {
}))
.subscribe(
versions => {
this.chartVersions = versions.filter(x => x.version.includes(this.lastFilteredVersionName));
this.chartVersions = versions.filter(x => x?.version?.includes(this.lastFilteredVersionName));
this.totalCount = versions.length;
},
err => {