- addresses issue #1839

Nothing controversial. Just check for the existence of children before trying to index. I wasn't able to reproduce the error, thus am unable to verify if this actually fixes #1839 or not