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

Commit 8514806

Browse files
committed
Merge commit '39317cf2254b4f139042f134fc7a25b5353da5eb' into hotfixes
2 parents d12e556 + 39317cf commit 8514806

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
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/ViewControllers/Source/SourceTreeViewController.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,21 @@ private void GoToSourceTree(Octokit.RepositoryContent content)
230230

231231
private void GoToSubModule(Octokit.RepositoryContent content)
232232
{
233+
if (content == null)
234+
return;
235+
233236
var gitUrl = content.GitUrl;
234-
var nameAndSlug = gitUrl.Substring(gitUrl.IndexOf("/repos/", StringComparison.Ordinal) + 7);
237+
if (string.IsNullOrEmpty(gitUrl))
238+
return;
239+
240+
var repoDelimIndex = gitUrl.IndexOf("/repos/", StringComparison.Ordinal);
241+
if (repoDelimIndex < 0 || repoDelimIndex + 7 > gitUrl.Length)
242+
return;
243+
244+
var nameAndSlug = gitUrl.Substring(repoDelimIndex + 7);
235245
var indexOfGit = nameAndSlug.LastIndexOf("/git", StringComparison.Ordinal);
236246
indexOfGit = indexOfGit < 0 ? 0 : indexOfGit;
247+
237248
var repoId = RepositoryIdentifier.FromFullName(nameAndSlug.Substring(0, indexOfGit));
238249
if (repoId == null)
239250
return;

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)