Skip to content

Commit

Permalink
fix: fix edge-case, where commit type was an empty array
Browse files Browse the repository at this point in the history
Ref:#237
Time-spent: 0h23m
  • Loading branch information
TBalint2000 committed Jul 16, 2024
1 parent b22b510 commit d6cd114
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ function addActualTime(commits: any[]) {

async function addTypeToCommits(commits: any[]) {
for (const c of commits) {
c.commitType = await getCommitType(c.message);
const commitType = (await getCommitType(c.message));
if (!commitType || commitType.length === 0) {
c.commitType = [{label: 'unknown', value: 1}];
} else {
c.commitType = commitType.map(type => {
return {label: type.label.substring(9), value: type.value};
});
}
}
}

0 comments on commit d6cd114

Please sign in to comment.