mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
fix: check for nulls in route switch descriptors
This commit is contained in:
@@ -23,9 +23,9 @@
|
|||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
if (SwitchingDevice is IRouting)
|
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
|
else
|
||||||
return $"{SwitchingDevice.Key} switches to input {InputPort.Key}";
|
return $"{SwitchingDevice?.Key} switches to input {InputPort?.Key}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ namespace PepperDash.Essentials.Core.Routing
|
|||||||
var currentRoute = midpoint.CurrentRoutes.FirstOrDefault(route => {
|
var currentRoute = midpoint.CurrentRoutes.FirstOrDefault(route => {
|
||||||
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Checking {route} against {tieLine}", this, route, tieLine);
|
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)
|
if (currentRoute == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user