diff --git a/resources/inc/class.resources_bo.inc.php b/resources/inc/class.resources_bo.inc.php index 08b47bd725..5482c45fdf 100755 --- a/resources/inc/class.resources_bo.inc.php +++ b/resources/inc/class.resources_bo.inc.php @@ -583,9 +583,12 @@ class resources_bo ); $only_keys = 'res_id,name'; $data = $this->so->search(array(),$only_keys,$order_by='name',$extra_cols='',$wildcard='%',$empty,$op='OR',$limit,$filter); - foreach($data as $resource) + if(is_array($data) && $data) { - $resources[$resource['res_id']] = $resource['name']; + foreach($data as $resource) + { + $resources[$resource['res_id']] = $resource['name']; + } } return $resources;