I am trying to add each numeric digit in a textbox to a list(of Integer) but I am required to use integer.Parse to get it into the correct format, but upon doing so receive a "Object reference not set to an instance of an object" error. My code is as follows:
Dim key As List(Of Integer)
Dim digit As Integer
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    For Each c As Char In TextBox1.Text
        digit = Integer.Parse(c)
        key.Add(digit)
    Next
End Sub
 
     
    