Skip to content

Commit 9fca08c

Browse files
authored
fix: ignore null in timeline event (#8022) (#8058)
Fixes #8028
1 parent 7f0fc29 commit 9fca08c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/github/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export interface TimelineEventsResponse {
262262
repository: {
263263
pullRequest: {
264264
timelineItems: {
265-
nodes: (MergedEvent | Review | IssueComment | Commit | AssignedEvent | HeadRefDeletedEvent)[];
265+
nodes: (MergedEvent | Review | IssueComment | Commit | AssignedEvent | HeadRefDeletedEvent | null)[];
266266
};
267267
};
268268
} | null;

src/github/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ export async function parseCombinedTimelineEvents(
11181118
| GraphQL.AssignedEvent
11191119
| GraphQL.HeadRefDeletedEvent
11201120
| GraphQL.CrossReferencedEvent
1121+
| null
11211122
)[],
11221123
restEvents: Common.TimelineEvent[],
11231124
githubRepository: GitHubRepository,
@@ -1147,6 +1148,9 @@ export async function parseCombinedTimelineEvents(
11471148

11481149
// TODO: work the rest events into the appropriate place in the timeline
11491150
for (const event of events) {
1151+
if (!event) {
1152+
continue;
1153+
}
11501154
const type = convertGraphQLEventType(event.__typename);
11511155

11521156
switch (type) {

0 commit comments

Comments
 (0)