From 760265d136ac6652958681a0571baceec88c5c87 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 18 Dec 2020 10:19:49 +0100 Subject: [PATCH] check if folder for jstree is actually accesible --- views/bootstrap/class.Bootstrap.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 = ;