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

Commit b952af5

Browse files
authored
Merge pull request #1942 from github/fixes/1927-startpage-clone
Fix start page clone.
2 parents 7faf3bc + 44fe129 commit b952af5

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/GitHub.App/Services/DialogService.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@ public DialogService(
3131

3232
public async Task<CloneDialogResult> ShowCloneDialog(IConnection connection)
3333
{
34-
Guard.ArgumentNotNull(connection, nameof(connection));
35-
3634
var viewModel = factory.CreateViewModel<IRepositoryCloneViewModel>();
3735

38-
return (CloneDialogResult)await showDialog.Show(
39-
viewModel,
40-
connection,
41-
ApiClientConfiguration.RequestedScopes)
42-
.ConfigureAwait(false);
36+
if (connection != null)
37+
{
38+
return (CloneDialogResult)await showDialog.Show(
39+
viewModel,
40+
connection,
41+
ApiClientConfiguration.RequestedScopes)
42+
.ConfigureAwait(false);
43+
}
44+
else
45+
{
46+
return (CloneDialogResult)await showDialog.ShowWithFirstConnection(viewModel)
47+
.ConfigureAwait(false);
48+
}
4349
}
4450

4551
public async Task<string> ShowReCloneDialog(IRepositoryModel repository)

src/GitHub.TeamFoundation.14/Base/TeamExplorerSectionBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public virtual void SaveContext(object sender, SectionSaveContextEventArgs e)
118118

119119
protected ITeamExplorerSection GetSection(Guid section)
120120
{
121-
var tep = (ITeamExplorerPage)TEServiceProvider.GetServiceSafe(typeof(ITeamExplorerPage));
121+
// Return null if section hasn't been initialized yet
122+
var tep = (ITeamExplorerPage)TEServiceProvider?.GetServiceSafe(typeof(ITeamExplorerPage));
122123
return tep?.GetSection(section);
123124
}
124125
}

src/GitHub.VisualStudio/Services/ShowDialogService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ public async Task<object> ShowWithFirstConnection<TViewModel>(TViewModel viewMod
7575
using (var dialogViewModel = CreateViewModel())
7676
using (dialogViewModel.Done.Take(1).Subscribe(x => result = x))
7777
{
78-
await dialogViewModel.StartWithConnection(viewModel);
79-
78+
var task = dialogViewModel.StartWithConnection(viewModel);
8079
var window = new GitHubDialogWindow(dialogViewModel);
8180
window.ShowModal();
81+
await task;
8282
}
8383

8484
return result;

0 commit comments

Comments
 (0)