fixed corner-case

This commit is contained in:
Timo Bejan 2020-10-29 09:28:52 +02:00
parent 671c7ecfdd
commit 75ff8249f0

View File

@ -119,10 +119,12 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
}
private _calculateChartConfig() {
const groups = groupBy(this.appStateService.activeProject.files, 'status');
this.documentsChartData = [];
for (const key of Object.keys(groups)) {
this.documentsChartData.push({ value: groups[key].length, color: key, label: key });
if (this.appStateService.activeProject) {
const groups = groupBy(this.appStateService.activeProject?.files, 'status');
this.documentsChartData = [];
for (const key of Object.keys(groups)) {
this.documentsChartData.push({ value: groups[key].length, color: key, label: key });
}
}
}