Skip to content

Commit a5e8ec8

Browse files
committed
Sometimes cross-ref event is missing source
1 parent e088e4b commit a5e8ec8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/github/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface CrossReferencedEvent {
3939
id: string;
4040
actor: Actor;
4141
createdAt: string;
42-
source: {
42+
source?: {
4343
__typename: string;
4444
number: number;
4545
url: string;

src/github/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,9 @@ export async function parseCombinedTimelineEvents(
12651265
break;
12661266
case Common.EventType.CrossReferenced:
12671267
const crossRefEv = event as GraphQL.CrossReferencedEvent;
1268+
if (!crossRefEv.source) {
1269+
break;
1270+
}
12681271
const isIssue = crossRefEv.source.__typename === 'Issue';
12691272
const extensionUrl = isIssue
12701273
? await toOpenIssueWebviewUri({ owner: crossRefEv.source.repository.owner.login, repo: crossRefEv.source.repository.name, issueNumber: crossRefEv.source.number })

0 commit comments

Comments
 (0)