I have a nested struct like so struct1.struct2.foo. I would like to check if foo exists. However, struct2 isn't guaranteed to exists either. I loathe to use isDefined(), but I also think that calling structKeyExists() twice is wasteful (e.g., if (structKeyExists(struct, 'struct2') && structKeyExists(struct.struct2, 'foo')) {}
I thought about using structFindKey(), but then I don't want to run into an issue if there exists struct1.foo
Is there a better way to accomplish this?
This is a similar question to this question, but I am not dealing with an XML document so most of the answers in that post doesn't work for me.