CustomersFound
is an ArrayList
defined as follows:
Public CustomersFound As ArrayList
A NullReferenceException
is thrown when I try to add to the collection.
CustomersFound.Add(Node)
The exact message states: "Object reference not set to an instance of an object".
I'm adding to the ArrayList
in a public subroutine as follows:
Public Sub SearchTraverse(ByVal Node As Customer, Surname As String)
' Code to search for customers here...
CustomersFound.Add(Node)
End Sub
Can anybody help me as to why I am getting this error?