Skip to content

Commit 25f5fa5

Browse files
authored
fix: handle unset item.content (#127)
closes #126
1 parent 217dad5 commit 25f5fa5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

api/lib/project-item-node-to-github-project-item.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export function projectItemNodeToGitHubProjectItem(state, itemNode) {
3333
};
3434
}
3535

36-
if (itemNode.type === "ISSUE" || itemNode.type === "PULL_REQUEST") {
36+
const isIssueOrPullRequest =
37+
itemNode.type === "ISSUE" || itemNode.type === "PULL_REQUEST";
38+
// content might be unset for deleted issues / pull requests (e.g. in case of a deleted spam user)
39+
const hasContent = itemNode.content !== null;
40+
41+
if (isIssueOrPullRequest && hasContent) {
3742
// item is issue or pull request
3843
const issue = {
3944
id: itemNode.content.id,

0 commit comments

Comments
 (0)