[BUG] Fix rare ArgumentOutOfRangeException (#132), [BUG] Fix rare NullReferenceException (#133)

This commit is contained in:
Markus Hofknecht 2020-08-04 10:58:20 +02:00
parent 6c63a4a6fe
commit ae440e4389
4 changed files with 14 additions and 10 deletions

View file

@ -215,13 +215,17 @@ namespace SystemTrayMenu.Handler
iRowKey = i;
iMenuKey = newiMenuKey;
DataGridViewRow row = dgv.Rows[i];
RowData rowData = (RowData)row.Cells[2].Value;
rowData.IsSelected = true;
if (refreshview)
if (dgv.Rows.Count > i)
{
row.Selected = false;
row.Selected = true;
DataGridViewRow row = dgv.Rows[i];
RowData rowData = (RowData)row.Cells[2].Value;
rowData.IsSelected = true;
if (refreshview)
{
row.Selected = false;
row.Selected = true;
}
}
}

View file

@ -456,7 +456,7 @@ namespace SystemTrayMenu.Business
// Case when Folder Dialog open
}
else if (openCloseState == OpenCloseState.Opening ||
(menus[0].Visible && openCloseState == OpenCloseState.Default))
(menus[0] != null && menus[0].Visible && openCloseState == OpenCloseState.Default))
{
openCloseState = OpenCloseState.Closing;
MenusFadeOut();

View file

@ -9,7 +9,7 @@
<Identity
Name="49543SystemTrayMenu.SystemTrayMenu"
Publisher="CN=5884501C-92ED-45DE-9508-9D987C314243"
Version="1.0.11.0" />
Version="1.0.14.0" />
<Properties>
<DisplayName>SystemTrayMenu</DisplayName>

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.12.0")]
[assembly: AssemblyFileVersion("1.0.12.0")]
[assembly: AssemblyVersion("1.0.14.0")]
[assembly: AssemblyFileVersion("1.0.14.0")]