Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Fix for NullPointer Exception after column resize. #42

Merged
merged 2 commits into from
Mar 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions UnityLauncher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -871,12 +871,21 @@ private void btnOpenLogFolder_Click(object sender, EventArgs e)

private void gridRecent_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
List<int> gridWidths = new List<int>(Properties.Settings.Default.gridColumnWidths);
List<int> gridWidths;
if (Properties.Settings.Default.gridColumnWidths != null )
{
gridWidths = new List<int>(Properties.Settings.Default.gridColumnWidths);
}
else
{
gridWidths = new List<int>();
}

// restore data grid view widths
var colum = gridRecent.Columns[0];
for (int i = 0; i < gridRecent.Columns.Count; ++i)
{
if (Properties.Settings.Default.gridColumnWidths.Length > i)
if (Properties.Settings.Default.gridColumnWidths != null && Properties.Settings.Default.gridColumnWidths.Length > i)
{
gridWidths[i] = gridRecent.Columns[i].Width;
}
Expand Down