diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index b42e00940..9d686bbfd 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1899,8 +1899,7 @@ $(document).ready(function() { } /* }}} */ $orderdir = (isset($orderby[1]) ? ($orderby[1] == 'd' ? 'desc' : 'asc') : 'asc'); - if($folderid) { - $folder = $this->params['dms']->getFolder($folderid); + if($folderid && ($folder = $this->params['dms']->getFolder($folderid))) { if(!$partialtree) { $path = $folder->getPath(); /* Get the first folder (root folder) of path */ @@ -1930,8 +1929,10 @@ $(document).ready(function() { } } else { - $root = $this->params['dms']->getFolder($this->params['rootfolderid']); - $tree = array(array('label'=>$root->getName(), 'id'=>$root->getID(), 'load_on_demand'=>false, 'is_folder'=>true)); + if($root = $this->params['dms']->getFolder($this->params['rootfolderid'])) + $tree = array(array('label'=>$root->getName(), 'id'=>$root->getID(), 'load_on_demand'=>false, 'is_folder'=>true)); + else + $tree = array(); } ?> var data = ;