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

Commit 0b7f956

Browse files
committed
Fix null ref exception in SafeMode
1 parent a3aca21 commit 0b7f956

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ void NotifyActiveRepo()
135135

136136
void UpdateActiveRepo()
137137
{
138-
var repo = gitService.ActiveRepositories.FirstOrDefault();
138+
// NOTE: gitService will be null in Expression Blend or Safe Mode
139+
var repo = gitService?.ActiveRepositories.FirstOrDefault();
140+
139141
if (!Equals(repo, ActiveRepo))
140142
// so annoying that this is on the wrong thread
141143
syncContext.Post(r => ActiveRepo = r as ILocalRepositoryModel, repo);

0 commit comments

Comments
 (0)