Check for node is null, before node.parentNode

Checks that the 'node' variable passed to getParent() function isn't null.
Merge pull request #60 from dylan-baskind/master

Check for node is null, before node.parentNode