Check for UIAElementNil before looking up child elements

In some of my tests, I found that child can actually be a UIAElementNil object. Doing this check fixed the Javascript Error that was getting thrown when I was trying to call _elementOrElementsWithPredicateWeighted on it.