avoids potential exception if result of childNodes() is undefined

this avoids the following exception

![](http://content.screencast.com/users/chiller/folders/Jing/media/d78cb41d-b1dd-4957-acde-6ec41bf864ea/00000125.png)

I'm not sure what causes this exactly.