I am trying to loop through a vectors elements and trying to find out if a position in the vector is equal to null…
if(_vecForShapes.get(i)!=null)//this line works fine but when it gets to a position where it is null it gives me an error? Any ideas?
{
}
Thanks!
Are you sure that it is get(i) that is null, and not that you have exceeded the number of items in _vecForShapes? It is much more likely that the _vecForShapes.get(i) is throwing an error than the comparison to null.
What type does get(i) return?