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")); } } }