From 8cf6e7fc03af4eb1aeca5622e50f91f94f425498 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Thu, 31 Jan 2008 09:18:47 +0000 Subject: Handle emtpy screens config section --- packages/lcdproc/lcdproc.inc | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/lcdproc/lcdproc.inc b/packages/lcdproc/lcdproc.inc index 4aff2ca0..d95dce84 100644 --- a/packages/lcdproc/lcdproc.inc +++ b/packages/lcdproc/lcdproc.inc @@ -245,21 +245,23 @@ /* generate rc file start and stop */ $options = ""; - foreach($lcdproc_screens_config as $name => $screen) { - if($screen == "on") { - switch($name) { - case "scr_cpu": - $options .= "P "; - break; - case "scr_time": - $options .= "O "; - break; - case "scr_load": - $options .= "L "; - break; - case "scr_uptime": - $options .= "U "; - break; + if(is_array($lcdproc_screens_config)) { + foreach($lcdproc_screens_config as $name => $screen) { + if($screen == "on") { + switch($name) { + case "scr_cpu": + $options .= "P "; + break; + case "scr_time": + $options .= "O "; + break; + case "scr_load": + $options .= "L "; + break; + case "scr_uptime": + $options .= "U "; + break; + } } } } -- cgit v1.2.3