Skip to content

Commit 1f79dd6

Browse files
authored
fix: ignore null in timeline event (#8022)
1 parent 2157a82 commit 1f79dd6

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
@@ -1120,6 +1120,7 @@ export async function parseCombinedTimelineEvents(
11201120
| GraphQL.AssignedEvent
11211121
| GraphQL.HeadRefDeletedEvent
11221122
| GraphQL.CrossReferencedEvent
1123+
| null
11231124
)[],
11241125
restEvents: Common.TimelineEvent[],
11251126
githubRepository: GitHubRepository,
@@ -1149,6 +1150,9 @@ export async function parseCombinedTimelineEvents(
11491150

11501151
// TODO: work the rest events into the appropriate place in the timeline
11511152
for (const event of events) {
1153+
if (!event) {
1154+
continue;
1155+
}
11521156
const type = convertGraphQLEventType(event.__typename);
11531157

11541158
switch (type) {

0 commit comments

Comments
 (0)