diff --git a/UnityLauncher/Form1.cs b/UnityLauncher/Form1.cs index 1943037..70781db 100644 --- a/UnityLauncher/Form1.cs +++ b/UnityLauncher/Form1.cs @@ -1128,10 +1128,10 @@ private void UnityVersionsListDownloaded(object sender, DownloadStringCompletedE string GetSelectedRowData(string key) { string path = null; - var selected = gridRecent.CurrentCell.RowIndex; - if (selected > -1) + var selected = gridRecent?.CurrentCell?.RowIndex; + if (selected.HasValue && selected > -1) { - path = gridRecent.Rows[selected].Cells[key].Value?.ToString(); + path = gridRecent.Rows[selected.Value].Cells[key].Value?.ToString(); } return path; }