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

Commit 220ac7a

Browse files
committed
Using commit.Committer.Name
1 parent 0054884 commit 220ac7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,11 @@ public virtual async Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddr
365365
when.Commit(commit => new CommitModel
366366
{
367367
AbbreviatedOid = commit.AbbreviatedOid,
368-
// TODO: commit.Author.User can be null
368+
369369
Author = new ActorModel
370370
{
371-
Login = commit.Author.User.Login,
372-
AvatarUrl = commit.Author.User.AvatarUrl(null),
371+
Login = commit.Author.User == null ? commit.Committer.Name : commit.Author.User.Login,
372+
AvatarUrl = commit.Author.User == null ? "" : commit.Author.User.AvatarUrl(null),
373373
},
374374
MessageHeadline = commit.MessageHeadline,
375375
Oid = commit.Oid,

0 commit comments

Comments
 (0)