Skip to content

Commit 11edee8

Browse files
committed
Fix RTE when testexplorer has never been made visible
1 parent 9db8fb8 commit 11edee8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Rubberduck.Core/UI/UnitTesting/TestExplorerControl.xaml.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@ private void ResultsGroupingGrid_IsVisibleChanged(object sender, System.Windows.
8585
_newGroupingGrid = groupingGrid;
8686
else
8787
{
88-
// copy column widths from previously visible grouping grid to ensure widths are consistent
89-
for (int columnIndex = 0; columnIndex < groupingGrid.Columns.Count; columnIndex++)
88+
if (!(_newGroupingGrid is null))
9089
{
91-
// copy column widths from current now hidden columns to the new visible columns
92-
_newGroupingGrid.Columns[columnIndex].Width = groupingGrid.Columns[columnIndex].Width;
90+
// copy column widths from previously visible grouping grid to ensure widths are consistent
91+
for (int columnIndex = 0; columnIndex < groupingGrid.Columns.Count; columnIndex++)
92+
{
93+
// copy column widths from current now hidden columns to the new visible columns
94+
_newGroupingGrid.Columns[columnIndex].Width = groupingGrid.Columns[columnIndex].Width;
95+
}
9396
}
9497
}
9598
}

0 commit comments

Comments
 (0)