summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-04-06 16:10:06 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-04-06 16:10:06 +0000
commitc2eb36d9cf93163593edbaa53454e26cc546f081 (patch)
tree8197c49fef9024b591887a77141a54a2657fe636 /etc
parent9f71ee2f13bf4ac1d70604edf668b2e513322dc8 (diff)
downloadpfsense-c2eb36d9cf93163593edbaa53454e26cc546f081.zip
pfsense-c2eb36d9cf93163593edbaa53454e26cc546f081.tar.gz
Do not foreach through installedpackages if no installed packages exist.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 38b6b03..05df632 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -370,10 +370,11 @@ function get_pkg_id($pkg_name) {
global $config;
global $pkg_config;
$i=0;
- foreach ($config['installedpackages']['package'] as $pkg) {
- if($pkg['name'] == $pkg_name) return $i;
- $i++;
- }
+ if(is_array($config['installedpackages']['package']))
+ foreach ($config['installedpackages']['package'] as $pkg) {
+ if($pkg['name'] == $pkg_name) return $i;
+ $i++;
+ }
return -1;
}
OpenPOWER on IntegriCloud