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

Commit 3d2d2ef

Browse files
authored
Fix exception when hooking repochanged event
Check IVSGitExt isn't null before hooking ActiveRepositoriesChanged event.
1 parent 0b7f956 commit 3d2d2ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public TeamExplorerServiceHolder(IVSGitExt gitService)
3535
syncContext = SynchronizationContext.Current;
3636

3737
UpdateActiveRepo();
38-
gitService.ActiveRepositoriesChanged += UpdateActiveRepo;
38+
if (gitService != null)
39+
{
40+
gitService.ActiveRepositoriesChanged += UpdateActiveRepo;
41+
}
3942
}
4043

4144

0 commit comments

Comments
 (0)