Avoid warning on missing accessories

This commit is contained in:
Nathan Gray 2012-04-12 22:18:22 +00:00
parent 0cfed6ba11
commit 4aa875b885

View File

@ -312,9 +312,11 @@ class resources_bo
if($res_id < 1){return;}
$data = $this->so->search('','res_id,name','','','','','',$start,array('accessory_of' => $res_id),'',$need_full_no_count=true);
$acc_list = array();
foreach($data as $num => $resource)
{
$acc_list[$resource['res_id']] = $resource['name'];
if($data) {
foreach($data as $num => $resource)
{
$acc_list[$resource['res_id']] = $resource['name'];
}
}
return $acc_list;
}