Skip to content

Commit

Permalink
fix: 🐛 cannot read property 'login' of null
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Jun 9, 2021
1 parent 83d4625 commit 39f3c94
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "activity-report",
"description": "A Github Action to generate a periodic automated summary of activities and happening on your Github repository.",
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/index.js",
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion src/commits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export namespace Commits {
`[${commit.commit.message.replace(/\n/g, ' ')}](${commit.html_url})`

const userLink = (commit: CommitList[0]) =>
`[${commit.author!.login}](${commit.author!.html_url})`
commit.author ? `[${commit.author.login}](${commit.author.html_url})` : ''

export function render(
commitList: CommitList = [],
Expand Down
2 changes: 1 addition & 1 deletion src/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export namespace Issues {
`[${issue.title.replace(/\n/g, ' ')}](${issue.html_url})`

const userLink = (issue: IssueList[0]) =>
`[${issue.user!.login}](${issue.user!.html_url})`
issue.user ? `[${issue.user.login}](${issue.user.html_url})` : ''

const anchor = '<!-- activity-report-anchor -->'

Expand Down
2 changes: 1 addition & 1 deletion src/pulls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export namespace PullRequests {
`[${pr.title.replace(/\n/g, ' ')}](${pr.html_url})`

const userLink = (pr: PullRequestList[0]) =>
`[${pr.user!.login}](${pr.user!.html_url})`
pr.user ? `[${pr.user.login}](${pr.user.html_url})` : ''

export function render(
pullRequestList: PullRequestList = [],
Expand Down
4 changes: 3 additions & 1 deletion src/stargazers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export namespace Stargazers {
{
stargazer,
stargazers,
userLink: `[${stargazer!.login}](${stargazer!.html_url})`,
userLink: stargazer
? `[${stargazer.login}](${stargazer.html_url})`
: '',
},
true,
)
Expand Down

0 comments on commit 39f3c94

Please sign in to comment.