How to check, whether reference is setted to an object or not
There is an array with 1000 cells. I've putted in there 50 object, so there is 950 cells(not used references) left.

I want to loop through 50 objects placed in array, then leave the loop.
Right now, loop is entering into array[51] and I'm getting the error:
**Object reference not set to an instance of an object.**

i've tried condition if (array[i] != null) but it doesn't work, 

thanks :P :)

How to check, whether reference is setted to an object or not
===

There is an array with 1000 cells. I've putted in there 50 object, so there is 950 cells(not used references) left.

I want to loop through 50 objects placed in array, then leave the loop.
Right now, loop is entering into array[51] and I'm getting the error:
**Object reference not set to an instance of an object.**

i've tried condition if (array[i] != null) but it doesn't work, 

thanks :P :)
