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

Commit 68b6b4c

Browse files
committed
Check for null before invoking DiffFile.
Fixes #2082
1 parent 9124705 commit 68b6b4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestFilesView.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ void changesTree_ContextMenuOpening(object sender, ContextMenuEventArgs e)
3434
void changesTree_MouseDoubleClick(object sender, MouseButtonEventArgs e)
3535
{
3636
var file = (e.OriginalSource as FrameworkElement)?.DataContext as IPullRequestFileNode;
37-
(DataContext as IPullRequestFilesViewModel)?.DiffFile.Execute(file);
37+
38+
if (file != null)
39+
{
40+
(DataContext as IPullRequestFilesViewModel)?.DiffFile.Execute(file);
41+
}
3842
}
3943

4044
void changesTree_MouseRightButtonDown(object sender, MouseButtonEventArgs e)

0 commit comments

Comments
 (0)