diff --git a/src/github/graphql.ts b/src/github/graphql.ts index f8abed5b44..ad48671e85 100644 --- a/src/github/graphql.ts +++ b/src/github/graphql.ts @@ -262,7 +262,7 @@ export interface TimelineEventsResponse { repository: { pullRequest: { timelineItems: { - nodes: (MergedEvent | Review | IssueComment | Commit | AssignedEvent | HeadRefDeletedEvent)[]; + nodes: (MergedEvent | Review | IssueComment | Commit | AssignedEvent | HeadRefDeletedEvent | null)[]; }; }; } | null; diff --git a/src/github/utils.ts b/src/github/utils.ts index e8a689ed33..fba9d565ec 100644 --- a/src/github/utils.ts +++ b/src/github/utils.ts @@ -1120,6 +1120,7 @@ export async function parseCombinedTimelineEvents( | GraphQL.AssignedEvent | GraphQL.HeadRefDeletedEvent | GraphQL.CrossReferencedEvent + | null )[], restEvents: Common.TimelineEvent[], githubRepository: GitHubRepository, @@ -1149,6 +1150,9 @@ export async function parseCombinedTimelineEvents( // TODO: work the rest events into the appropriate place in the timeline for (const event of events) { + if (!event) { + continue; + } const type = convertGraphQLEventType(event.__typename); switch (type) {