If I have an array of objects, how do I check if an object exists at part of the array?

I tried if object=null but it said i need a 'variant'