From 195f45ca475f62c7bb6e0d8047fe7431ac5fc770 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 2 Jul 2015 13:18:35 +0000 Subject: [PATCH] (legacy) check if gateways.gateway_item exists --- src/etc/inc/gwlb.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index 7c5a4fe8a..217a3ea7c 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -1076,9 +1076,11 @@ function gateway_is_gwgroup_member($name) { function is_apinger_enabled() { global $config; $gwcount=0; - foreach($config['gateways']['gateway_item'] as $gwkey => $gateway) { - if (!isset($gateway['monitor_disable']) || $gateway['monitor_disable'] == "0") { - $gwcount += 1; + if (isset($config['gateways']['gateway_item'])) { + foreach($config['gateways']['gateway_item'] as $gwkey => $gateway) { + if (!isset($gateway['monitor_disable']) || $gateway['monitor_disable'] == "0") { + $gwcount += 1; + } } }