--- nodehierarchy_token-old.inc	2007-12-18 06:10:18.220298500 +0100
+++ nodehierarchy_token.inc	2007-12-18 05:56:14.685421000 +0100
@@ -8,7 +8,7 @@
 
 
 function nodehierarchy_token_values($type, $object = NULL, $options = array()) {
-  if ($type == 'node'){
+  if ($type == 'node' && isset($object->parent)) {
     $node = $object;
     $parent = node_load( $node->parent );
     $tokens['hierarchyparenttitle']        = check_plain( @$parent->title );
