From 4aa875b885f31b1ffd1c3337aadaf886991c050d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 12 Apr 2012 22:18:22 +0000 Subject: [PATCH] Avoid warning on missing accessories --- resources/inc/class.resources_bo.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/inc/class.resources_bo.inc.php b/resources/inc/class.resources_bo.inc.php index 51720bc0d3..bb9ea1eaf8 100755 --- a/resources/inc/class.resources_bo.inc.php +++ b/resources/inc/class.resources_bo.inc.php @@ -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; }