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,13 +41,14 @@ $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) {
$rec['key'] = getOverallStatusText((int) $rec['key']); $rec['key'] = getOverallStatusText((int) $rec['key']);
} }
break; break;
}
} }
if($view) { if($view) {