fix: check for nulls in SwitchingDevice property

This commit is contained in:
Andrew Welker
2024-10-18 11:09:15 -05:00
parent f04f70495f
commit 631dd2b00d
2 changed files with 4 additions and 4 deletions

View File

@@ -217,7 +217,7 @@ namespace PepperDash.Essentials.Core.Routing
var currentRoute = midpoint.CurrentRoutes.FirstOrDefault(route => {
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Checking {route} against {tieLine}", this, route, tieLine);
return route.OutputPort?.Key == tieLine.SourcePort.Key && route.OutputPort?.ParentDevice.Key == tieLine.SourcePort.ParentDevice.Key;
return route.OutputPort != null && route.InputPort != null && route.OutputPort?.Key == tieLine.SourcePort.Key && route.OutputPort?.ParentDevice.Key == tieLine.SourcePort.ParentDevice.Key;
});
if (currentRoute == null)