do not access $data if there is none

This commit is contained in:
Uwe Steinmann 2019-06-27 14:18:39 +02:00
parent e8c9fd5e4e
commit cf6b852233

View File

@ -41,7 +41,7 @@ $type = 'docsperuser';
if(!empty($_GET['type'])) { if(!empty($_GET['type'])) {
$type = $_GET['type']; $type = $_GET['type'];
} }
$data = $dms->getStatisticalData($type); if($data = $dms->getStatisticalData($type)) {
switch($type) { switch($type) {
case 'docsperstatus': case 'docsperstatus':
foreach($data as &$rec) { foreach($data as &$rec) {
@ -49,6 +49,7 @@ switch($type) {
} }
break; break;
} }
}
if($view) { if($view) {
$view->setParam('rootfolder', $rootfolder); $view->setParam('rootfolder', $rootfolder);