listview.Items[x] is only returned if EditIndex is larger than zero. The following code will fix that:
privateListViewItem GetListViewEditItem (ListView listview)
{
if(listview.EditIndex >= 0 && listview.EditIndex < listview.Items.Count)
{
return listview.Items[listview.EditIndex];
}
returnnull;
}
Since the docs states it is a zero-based index I would consider this a bug.