Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit c1eba1b

Browse files
committed
Prevent Crash When Actor is Null
1 parent e6b6f5b commit c1eba1b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CodeHub.Core/ViewModels/Issues/IssueViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected override Task Load()
178178
.ToBackground(events =>
179179
{
180180
Events = events;
181-
Participants = events.Select(x => x.Actor.Login).Distinct().Count();
181+
Participants = events.Select(x => x.Actor?.Login).Distinct().Count();
182182
});
183183

184184
_applicationService

CodeHub.iOS/Views/Issues/IssueView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public async Task RenderComments()
180180

181181
var events = ViewModel
182182
.Events
183-
.Select(x => new Comment(x.Actor.AvatarUrl, x.Actor.Login, CreateEventBody(x.Event.StringValue, x.CommitId), x.CreatedAt));
183+
.Select(x => new Comment(x.Actor?.AvatarUrl, x.Actor?.Login, CreateEventBody(x.Event.StringValue, x.CommitId), x.CreatedAt));
184184

185185
var items = comments
186186
.Concat(events)

0 commit comments

Comments
 (0)