mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
fix(Core): Add return if port number is greater than supported ports on the device
This commit is contained in:
parent
4eace11943
commit
8393ae3ded
1 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue