From 1c8e5b8ba6b04d6d535154ea30809945c7050adc Mon Sep 17 00:00:00 2001 From: geo Date: Sat, 3 Mar 2018 12:57:30 +0100 Subject: [PATCH 1/2] Fix for NullPointer Exception after column resize. --- UnityLauncher/App.config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UnityLauncher/App.config b/UnityLauncher/App.config index 18502f3..f9f5fbc 100644 --- a/UnityLauncher/App.config +++ b/UnityLauncher/App.config @@ -45,6 +45,13 @@ False + + + + + + \ No newline at end of file From 89b87b0a44864d9ac7f57ce2392999c8ee5bdcce Mon Sep 17 00:00:00 2001 From: geo Date: Sat, 3 Mar 2018 17:55:43 +0100 Subject: [PATCH 2/2] Revert "Fix for NullPointer Exception after column resize." This reverts commit 1c8e5b8ba6b04d6d535154ea30809945c7050adc. Add new fix. --- UnityLauncher/App.config | 7 ------- UnityLauncher/Form1.cs | 13 +++++++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/UnityLauncher/App.config b/UnityLauncher/App.config index f9f5fbc..18502f3 100644 --- a/UnityLauncher/App.config +++ b/UnityLauncher/App.config @@ -45,13 +45,6 @@ False - - - - - - \ No newline at end of file diff --git a/UnityLauncher/Form1.cs b/UnityLauncher/Form1.cs index e101e61..02d8339 100644 --- a/UnityLauncher/Form1.cs +++ b/UnityLauncher/Form1.cs @@ -871,12 +871,21 @@ private void btnOpenLogFolder_Click(object sender, EventArgs e) private void gridRecent_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e) { - List gridWidths = new List(Properties.Settings.Default.gridColumnWidths); + List gridWidths; + if (Properties.Settings.Default.gridColumnWidths != null ) + { + gridWidths = new List(Properties.Settings.Default.gridColumnWidths); + } + else + { + gridWidths = new List(); + } + // 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; }