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

Commit 8218455

Browse files
Merge branch 'master' into l10n_master
2 parents da702f6 + b952af5 commit 8218455

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
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.Exports/Extensions/ServiceProviderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace GitHub.Extensions
88
{
99
public static class IServiceProviderExtensions
1010
{
11-
static readonly ILogger log = LogManager.ForContext<VSServices>();
11+
static readonly ILogger log = LogManager.ForContext(typeof(IServiceProviderExtensions));
1212

1313
/// <summary>
1414
/// Safe variant of GetService that doesn't throw exceptions if the service is

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)