In my code, I deal with an array that has some entries with many objects nested inside one another, where as some do not. It looks something like the following:
I use undefsafe religiously. It tests each level down into your object until it either gets the value you asked for, or it returns "undefined". But never errors.