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

Commit 3b10f23

Browse files
authored
Merge branch 'master' into fixes/1677-guard-reads-and-writes
2 parents 23040f7 + 82b2b6d commit 3b10f23

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/GitHub.VisualStudio/Commands/GoToSolutionOrPullRequestFileCommand.cs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,6 @@ void OnBeforeQueryStatus(object sender, EventArgs e)
150150
{
151151
try
152152
{
153-
var session = sessionManager.Value.CurrentSession;
154-
if (session == null)
155-
{
156-
// No active pull request session
157-
Visible = false;
158-
return;
159-
}
160-
161153
var sourceView = pullRequestEditorService.Value.FindActiveView();
162154
if (sourceView == null)
163155
{
@@ -185,13 +177,17 @@ void OnBeforeQueryStatus(object sender, EventArgs e)
185177
return;
186178
}
187179

188-
var relativePath = sessionManager.Value.GetRelativePath(textView.TextBuffer);
189-
if (relativePath != null)
180+
var session = sessionManager.Value.CurrentSession;
181+
if (session != null)
190182
{
191-
// Active text view is part of a repository
192-
Text = "View Changes in #" + session.PullRequest.Number;
193-
Visible = true;
194-
return;
183+
var relativePath = sessionManager.Value.GetRelativePath(textView.TextBuffer);
184+
if (relativePath != null)
185+
{
186+
// Active text view is part of a repository
187+
Text = "View Changes in #" + session.PullRequest.Number;
188+
Visible = true;
189+
return;
190+
}
195191
}
196192
}
197193
catch (Exception ex)

0 commit comments

Comments
 (0)