This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/GitHub.TeamFoundation.14/Base Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -42,17 +42,20 @@ public class TeamExplorerServiceHolder : ITeamExplorerServiceHolder
4242 /// <param name="joinableTaskFactory">Used for switching to the Main thread.</param>
4343 public TeamExplorerServiceHolder ( IVSGitExt gitService , JoinableTaskContext joinableTaskContext )
4444 {
45+ if ( gitService == null )
46+ {
47+ // This might be null in Blend or SafeMode
48+ return ;
49+ }
50+
4551 JoinableTaskCollection = joinableTaskContext . CreateCollection ( ) ;
4652 JoinableTaskCollection . DisplayName = nameof ( TeamExplorerServiceHolder ) ;
4753 JoinableTaskFactory = joinableTaskContext . CreateFactory ( JoinableTaskCollection ) ;
4854
4955 this . gitService = gitService ;
5056
5157 UpdateActiveRepo ( ) ;
52- if ( gitService != null )
53- {
54- gitService . ActiveRepositoriesChanged += UpdateActiveRepo ;
55- }
58+ gitService . ActiveRepositoriesChanged += UpdateActiveRepo ;
5659 }
5760
5861 // set by the sections when they get initialized
@@ -151,8 +154,7 @@ void NotifyActiveRepo()
151154
152155 void UpdateActiveRepo ( )
153156 {
154- // NOTE: gitService might be null in Blend or Safe Mode
155- var repo = gitService ? . ActiveRepositories . FirstOrDefault ( ) ;
157+ var repo = gitService . ActiveRepositories . FirstOrDefault ( ) ;
156158
157159 if ( ! Equals ( repo , ActiveRepo ) )
158160 {
You can’t perform that action at this time.
0 commit comments