From 03394fbc64cb204413bc7e5a6655259e1811fb70 Mon Sep 17 00:00:00 2001 From: mcrane Date: Wed, 1 Jul 2009 22:00:32 -0600 Subject: FreeSWITCH huntgroup check array size before looping through it. --- config/freeswitch/freeswitch.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'config/freeswitch') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index ad50234f..0a3929eb 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1339,10 +1339,12 @@ function sync_package_freeswitch_hunt_group() $tmp .= "\n"; //print_r($tmp_array); $x = 0; - foreach ($tmp_array as $row) { - $tmp .= " session.execute(\"".$row["application"]."\", ".$row["data"].");\n"; + if (count($tmp_array) > 0) { + foreach ($tmp_array as $row) { + $tmp .= " session.execute(\"".$row["application"]."\", ".$row["data"].");\n"; + } + unset($tmp_array); } - unset($tmp_array); break; } -- cgit v1.2.3