I believe this needs to check `child.nodeType === Node.ELEMENT_NODE` similar to line 178.  While testing the contacts app on the phone I am running into text nodes which results in a null ref when doing `child.tagName` here.