I have an issue in which I seem to be getting an error when running. The program closes when I try to execute line 134, and this seems to happen no matter what data type the temp variable is (I've tried object, string, list, listview). As best I can tell the list.get command is failing somehow, but I can't think of any other variations that might be causing this.
Included is a screenshot of the program taken while running. Top left is the code (problem line is the first one with debug option on), bottom left is the expanded list of contents of the ViewList variable, and right is the error I get when the program fails (which oddly references a function in the CustomListView module that I'm not even calling here).
Any help would be much appreciated! Also, code for the sub in question is here below. The problem line is temp=ViewList.Get(1)
Sub CheckUncheckButton_CheckedChange(Checked As Boolean)
Dim ViewList As List
Dim ListSize As Int
Dim CurrContact As cuContact
ListSize = ContactsCustListView.getsize
For i = 0 To ListSize-1
CurrContact.Initialize
ViewList.Initialize
ViewList = ContactsCustListView.GetPanels(i)
Dim temp As ListView
temp=ViewList.Get(1)
CurrContact = cu.FindContactsByName(ViewList.Get(1),False,False)
ContactsCustListView.RemoveAt(i)
'ContactsCustListView.InsertAt(i+1,CreateContactItem(CurrContact,True, ContactsCustListView.AsView.Width, 50dip), 50dip, CurrContact.Id) 'Add contact to list
Next
End Sub