Checking to see if an Web Containter exists


Can anyone tell me the code to use to check if a web container exists?

I am performing these calls but sometimes the object does not exist so I get a nil object error.
Call Self.cntGridMstr.GridControls
Call Self.cntGridMstr1.GridControls
Call Self.cntGridMstr2.GridControls

I think I should be checking first to see if the object exists, but do not know the code.
Thanks in advance,

Checking against nil doesn’t work?