Skip to content

Commit 820db25

Browse files
authored
timelineItem notes can be null (#8448)
Fixes #8447
1 parent 15fe752 commit 820db25

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/github/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export interface LatestUpdatesResponse {
322322
timelineItems: {
323323
nodes: ({
324324
createdAt: string;
325-
} | LatestCommit | LatestReviewThread)[];
325+
} | LatestCommit | LatestReviewThread | null)[];
326326
}
327327
}
328328
}

src/github/issueModel.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,13 @@ export class IssueModel<TItem extends Issue = Issue> extends Disposable {
450450
...(data.repository.pullRequest.comments.nodes.map(node => new Date(node.updatedAt))),
451451
...(data.repository.pullRequest.comments.nodes.flatMap(node => node.reactions.nodes.map(reaction => new Date(reaction.createdAt)))),
452452
...(data.repository.pullRequest.timelineItems.nodes.map(node => {
453-
const latestCommit = node as Partial<LatestCommit>;
454-
if (latestCommit.commit?.committedDate) {
453+
const latestCommit = node as (Partial<LatestCommit> | null);
454+
if (latestCommit?.commit?.committedDate) {
455455
return new Date(latestCommit.commit.committedDate);
456456
}
457-
const latestReviewThread = node as Partial<LatestReviewThread>;
458-
if ((latestReviewThread.comments?.nodes.length ?? 0) > 0) {
459-
return new Date(latestReviewThread.comments!.nodes[0].createdAt);
457+
const latestReviewThread = node as (Partial<LatestReviewThread> | null);
458+
if ((latestReviewThread?.comments?.nodes.length ?? 0) > 0) {
459+
return new Date(latestReviewThread!.comments!.nodes[0].createdAt);
460460
}
461461
return new Date((node as { createdAt: string }).createdAt);
462462
}))

0 commit comments

Comments
 (0)