diff --git a/includes/jstreebuilder.inc b/includes/jstreebuilder.inc index e9fc76b..23192b9 100644 --- a/includes/jstreebuilder.inc +++ b/includes/jstreebuilder.inc @@ -62,7 +62,10 @@ class JSTreeBuilder { $list = $this->xpath->query($query, $node); $roots = array(); foreach ($list as $component) { - $roots[] = $this->getComponentTree($component); + $root = $this->getComponentTree($component); + if ($root) { + $roots[] = $root; + } } return $roots; }