Forum Discussion
Also as I mentioned in my original post, checking for not null or null does not throw any error but I need to know if checking for not null will guarantee no problem accessing the properties of the objects.
I tried this on the niewPort and it worked so far as viewPort has been alwasy found.
Hi,
> I need to know if checking for not null will guarantee no problem accessing the properties of the objects.
No. As it is documented, .FindXXX() method always returns found object or object stub if the search finds nothing.
Thus check for not null will always succeed.
Correct way is to check for object.Exists and use aqObject.IsSupported(...) when needed.
- SZ_17 years agoOccasional Contributor
At AlexKaras
Thanks for your reply. I had realised that after I posted the messages and I already pointed this out on this thread on stackoverflow:
https://stackoverflow.com/questions/55857445/sometimes-exists-property-is-not-supported