V
vooose
Consider an ArrayList that you add an object to:
ArrayList list = new ArrayList();
if(myObj != null)
list.Add(myObj);
else
throw new Exception("obj cannot be null");
Some time down the track, I end up with a null object in my ArrayList -
I don't know how this happens. At no point do I reassign (eg list =
<something null>
Any ideas how my arraylist ends up with a null object?
ArrayList list = new ArrayList();
if(myObj != null)
list.Add(myObj);
else
throw new Exception("obj cannot be null");
Some time down the track, I end up with a null object in my ArrayList -
I don't know how this happens. At no point do I reassign (eg list =
<something null>
Any ideas how my arraylist ends up with a null object?