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

Commit 9c83ea0

Browse files
authored
Merge pull request #42 from geo-at-github/master
Fix for NullPointer Exception after column resize.
2 parents 4a243b9 + 89b87b0 commit 9c83ea0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: UnityLauncher/Form1.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,21 @@ private void btnOpenLogFolder_Click(object sender, EventArgs e)
871871

872872
private void gridRecent_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
873873
{
874-
List<int> gridWidths = new List<int>(Properties.Settings.Default.gridColumnWidths);
874+
List<int> gridWidths;
875+
if (Properties.Settings.Default.gridColumnWidths != null )
876+
{
877+
gridWidths = new List<int>(Properties.Settings.Default.gridColumnWidths);
878+
}
879+
else
880+
{
881+
gridWidths = new List<int>();
882+
}
883+
875884
// restore data grid view widths
876885
var colum = gridRecent.Columns[0];
877886
for (int i = 0; i < gridRecent.Columns.Count; ++i)
878887
{
879-
if (Properties.Settings.Default.gridColumnWidths.Length > i)
888+
if (Properties.Settings.Default.gridColumnWidths != null && Properties.Settings.Default.gridColumnWidths.Length > i)
880889
{
881890
gridWidths[i] = gridRecent.Columns[i].Width;
882891
}

0 commit comments

Comments
 (0)