In a pretty complicated application I have a function which does something with an object created by another procedure. There is a lot of things which should be properly set to create that object successfully. Sometimes object is not created at all. And an attempt to call one of its methods crashes application.
So, my question is: How can I find that object exists? I tried

If not(obj is nothing) then
obj.method
End if



but it doesn't work.
To find the reason why object was not created is difficult as well as to use error handler, because error handler itself (and it's standard for this application) contains that object.
Thank you.
Vlad