mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-02 22:34:57 +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;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user