I have declared a public arraylist: public input as arraylist = new arraylist()
at the general declaration seciton of my app.

When a button click event occurs, it gets a list of images from a folder, then for each image places an entry in a two dimensional array of arraylists, 2 arraylists for each image. the entry contains the arraylist filled by a subroutine, and the second one with another arraylist filled by another subroutine.

Then, i have a loop where it goes through the two dimensional array of arraylists, assigining the value of the first item of the second dimension of the array: input = trainingdata(a, 0). these are both system.arraylist type. then, it calls a subroutine.
Here is the important part.
the subroutine procedes to unload the items in input arraylist into an array. now for some reason, VB.NET throws an exception "Object reference not set to an instance of an object", with the value of input.item(a) being "nothing".
this makes no sense, for the arraylist is a public arraylist, declared specifically "... = New arraylist()" which instantiates object. being public, nothing should happen to it between subs. what is wrong here?