Skip to content

Commit cc03d40

Browse files
committed
Fix a regression where "rush version" would sometimes print an error:
"Error: The value for entries[0].comments.dependency[0].author is undefined"
1 parent 916da80 commit cc03d40

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

‎apps/rush-lib/src/logic/ChangelogGenerator.ts‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export class ChangelogGenerator {
5555
project.isMainProject
5656
);
5757

58-
if (changeLog) {
59-
updatedChangeLogs.push(changeLog);
60-
}
58+
if (changeLog) {
59+
updatedChangeLogs.push(changeLog);
60+
}
6161
}
6262
}
6363
}
@@ -129,11 +129,16 @@ export class ChangelogGenerator {
129129
changelogEntry.comments[changeTypeString] =
130130
changelogEntry.comments[changeTypeString] || [];
131131

132-
comments.push({
133-
author: individualChange.author,
134-
commit: individualChange.commit,
132+
const changeLogComment: IChangeLogComment = {
135133
comment: individualChange.comment
136-
});
134+
};
135+
if (individualChange.author) {
136+
changeLogComment.author = individualChange.author;
137+
}
138+
if (individualChange.commit) {
139+
changeLogComment.commit = individualChange.commit;
140+
}
141+
comments.push(changeLogComment);
137142
}
138143
});
139144

0 commit comments

Comments
 (0)