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

Commit f969094

Browse files
committed
Avoid using async void for Invalidate
This would have crashed Visual Studio if Invalidate had thrown. Moved async into a separate InvalidateAsync method.
1 parent 91fcd67 commit f969094

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Diagnostics;
33
using System.Drawing;
4+
using System.Threading.Tasks;
45
using GitHub.Api;
56
using GitHub.Extensions;
67
using GitHub.Logging;
@@ -39,10 +40,14 @@ public TeamExplorerNavigationItemBase(IGitHubServiceProvider serviceProvider,
3940
SubscribeToRepoChanges();
4041
}
4142

42-
public override async void Invalidate()
43+
public override void Invalidate()
4344
{
4445
IsVisible = false;
46+
InvalidateAsync().Forget(log);
47+
}
4548

49+
async Task InvalidateAsync()
50+
{
4651
var uri = ActiveRepoUri;
4752
var isVisible = await IsAGitHubRepo(uri);
4853
if (ActiveRepoUri != uri)

0 commit comments

Comments
 (0)