From 3f9d306a341059d754a11dc5457bba6822f1ff61 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 13 Nov 2020 16:03:02 -0700 Subject: [PATCH] fix conditions for getting mc --- PepperDashEssentials/ControlSystem.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 2188f1b0..2801e561 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -484,14 +484,15 @@ namespace PepperDash.Essentials { var mobileControlList = DeviceManager.AllDevices.OfType().ToList(); - if (mobileControlList.Count > 0) + if (mobileControlList.Count > 1) { - Debug.Console(0, Debug.ErrorLogLevel.Notice, - "Multiple instances of Mobile Control Server found. Using instance with key {0}", - mobileControlList[0].Key); + Debug.Console(0, Debug.ErrorLogLevel.Warning, + "Multiple instances of Mobile Control Server found."); + + return null; } - if (mobileControlList.Count != 0) + if (mobileControlList.Count > 0) { return mobileControlList[0]; }