From 98c20464d7068003805801fd8dedbbf1f109a59a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 24 Nov 2020 10:26:55 -0700 Subject: [PATCH] Addresses #505 --- PepperDashEssentials/ControlSystem.cs | 34 +++++++++++++++++---------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 2801e561..460086e0 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -536,23 +536,31 @@ namespace PepperDash.Essentials string logoLight = null; string logo = null; - if (c.Properties["logoDark"] != null) + try { - logoDark = c.Properties["logoDark"].Value("type"); - } + if (c.Properties["logoDark"] != null) + { + logoDark = c.Properties["logoDark"].Value("type"); + } - if (c.Properties["logoLight"] != null) + if (c.Properties["logoLight"] != null) + { + logoLight = c.Properties["logoLight"].Value("type"); + } + + if (c.Properties["logo"] != null) + { + logo = c.Properties["logo"].Value("type"); + } + + return ((logoDark != null && logoDark == "system") || + (logoLight != null && logoLight == "system") || (logo != null && logo == "system")); + } + catch (Exception e) { - logoLight = c.Properties["logoLight"].Value("type"); + Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config"); + return false; } - - if (c.Properties["logo"] != null) - { - logo = c.Properties["logo"].Value("type"); - } - - return ((logoDark != null && logoDark == "system") || - (logoLight != null && logoLight == "system") || (logo != null && logo == "system")); } } }