index: do not throw an Error when given a falsey DOM node, and a root element

This will fix: https://github.com/Automattic/html-pipe/issues/4

/cc @MatthewMueller