fix conditions for getting mc

This commit is contained in:
Andrew Welker
2020-11-13 16:03:02 -07:00
parent 14c3914e5c
commit 3f9d306a34

View File

@@ -484,14 +484,15 @@ namespace PepperDash.Essentials
{
var mobileControlList = DeviceManager.AllDevices.OfType<IMobileControl>().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];
}