mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
fix conditions for getting mc
This commit is contained in:
@@ -484,14 +484,15 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var mobileControlList = DeviceManager.AllDevices.OfType<IMobileControl>().ToList();
|
var mobileControlList = DeviceManager.AllDevices.OfType<IMobileControl>().ToList();
|
||||||
|
|
||||||
if (mobileControlList.Count > 0)
|
if (mobileControlList.Count > 1)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
Debug.Console(0, Debug.ErrorLogLevel.Warning,
|
||||||
"Multiple instances of Mobile Control Server found. Using instance with key {0}",
|
"Multiple instances of Mobile Control Server found.");
|
||||||
mobileControlList[0].Key);
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mobileControlList.Count != 0)
|
if (mobileControlList.Count > 0)
|
||||||
{
|
{
|
||||||
return mobileControlList[0];
|
return mobileControlList[0];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user