Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 48efdf9

Browse files
committed
Support of a null commit author
1 parent e3ea7db commit 48efdf9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,15 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(
388388
when.Commit(commit => new CommitModel
389389
{
390390
AbbreviatedOid = commit.AbbreviatedOid,
391-
// TODO: commit.Author.User can be null
392-
Author = new ActorModel
391+
Author = new CommitActorModel
393392
{
394-
Login = commit.Author.User.Login,
395-
AvatarUrl = commit.Author.User.AvatarUrl(null),
393+
Name = commit.Author.Name,
394+
Email = commit.Author.Email,
395+
User = commit.Author.User != null ? new ActorModel
396+
{
397+
Login = commit.Author.User.Login,
398+
AvatarUrl = commit.Author.User.AvatarUrl(null),
399+
} : null
396400
},
397401
MessageHeadline = commit.MessageHeadline,
398402
Oid = commit.Oid,

0 commit comments

Comments
 (0)