Bug fix : Program crashed when on-screen result items were defined for the first time on a PC (columnWidths == null).
This commit is contained in:
@@ -90,11 +90,11 @@ namespace Results.Forms
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Header
|
/// Header
|
||||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
|
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||||
int col = 1;
|
int col = 1;
|
||||||
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
foreach (var str in wMtr.GetAllDecoratedTestNames())
|
||||||
{
|
{
|
||||||
lView.Columns.Add(str, (columnWidths.Length > col) ? columnWidths[col] : 70);
|
lView.Columns.Add(str, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,13 +67,13 @@ namespace Results.Forms
|
|||||||
|
|
||||||
/// Always draw ListView header
|
/// Always draw ListView header
|
||||||
lView.Columns.Clear();
|
lView.Columns.Clear();
|
||||||
lView.Columns.Add(wmPosition.ToString(), (columnWidths.Length > 0) ? columnWidths[0] : 40);
|
lView.Columns.Add(wmPosition.ToString(), (columnWidths != null && columnWidths.Length > 0) ? columnWidths[0] : 40);
|
||||||
|
|
||||||
if (items == null || items.Count == 0) return;
|
if (items == null || items.Count == 0) return;
|
||||||
int col = 1;
|
int col = 1;
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
lView.Columns.Add(item.Caption, (columnWidths.Length > col) ? columnWidths[col] : 70);
|
lView.Columns.Add(item.Caption, (columnWidths != null && columnWidths.Length > col) ? columnWidths[col] : 70);
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user