--- views_tree.theme.inc	2010-11-03 21:52:18.000000000 +0100
+++ views_tree.theme.inc_new	2010-11-03 21:47:57.000000000 +0100
@@ -23,7 +23,7 @@ function theme_views_tree($view, $option
     $parents[] = $record->$options['main_field_property'];
   }
   foreach ($result as $record) {
-    if (! in_array($record->$options['parent_field_property'], $parents)) {
+    if (! in_array($record->$options['parent_field_property'], $parents) && $record->$options['parent_field_property'] === NULL) {
       $record->$options['parent_field_property'] = 0;
     }
   }
