mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
fix(Core): Add return if port number is greater than supported ports on the device
This commit is contained in:
@@ -90,12 +90,13 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dc.PortNumber > relayDevice.NumberOfRelayPorts)
|
if (dc.PortNumber <= relayDevice.NumberOfRelayPorts)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
return relayDevice.RelayPorts[dc.PortNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
return relayDevice.RelayPorts[dc.PortNumber];
|
Debug.Console(0, "Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user