diff --git a/src/PepperDash.Essentials.Core/Routing/RouteSwitchDescriptor.cs b/src/PepperDash.Essentials.Core/Routing/RouteSwitchDescriptor.cs index 080b932e..9e4aaca1 100644 --- a/src/PepperDash.Essentials.Core/Routing/RouteSwitchDescriptor.cs +++ b/src/PepperDash.Essentials.Core/Routing/RouteSwitchDescriptor.cs @@ -23,9 +23,9 @@ public override string ToString() { if (SwitchingDevice is IRouting) - return $"{SwitchingDevice?.Key} switches output {OutputPort.Key} to input {InputPort.Key}"; + return $"{SwitchingDevice?.Key} switches output {OutputPort?.Key} to input {InputPort?.Key}"; else - return $"{SwitchingDevice.Key} switches to input {InputPort.Key}"; + return $"{SwitchingDevice?.Key} switches to input {InputPort?.Key}"; } } diff --git a/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs b/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs index 28fefa96..e8809191 100644 --- a/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs +++ b/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs @@ -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?.Key == tieLine.SourcePort.Key && route.OutputPort?.ParentDevice.Key == tieLine.SourcePort.ParentDevice.Key; }); if (currentRoute == null)