diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php
index 820098ba0d..f4584ed026 100644
--- a/phpgwapi/inc/class.html.inc.php
+++ b/phpgwapi/inc/class.html.inc.php
@@ -1292,8 +1292,6 @@ class html
$folderImageDir = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/templates/default/images/';
}
- $html = self::div("\n",'id="'.$tree.'"',$_divClass);
-
static $tree_initialised=false;
if (!$tree_initialised)
{
@@ -1301,7 +1299,9 @@ class html
$html .= "\n";
$html .= "\n";
$tree_initialised = true;
+ if (!$_folders) return $html;
}
+ $html = self::div("\n",'id="'.$tree.'"',$_divClass).$html;
$html .= "