mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
fix: prevent processing of null or empty midpoint keys in RoutingFeedbackManager
This commit is contained in:
parent
f658fdf363
commit
abef1d095f
1 changed files with 8 additions and 1 deletions
|
|
@ -66,6 +66,9 @@ namespace PepperDash.Essentials.Core.Routing
|
|||
|
||||
foreach (var midpointKey in upstreamMidpoints)
|
||||
{
|
||||
if (string.IsNullOrEmpty(midpointKey))
|
||||
continue;
|
||||
|
||||
if (!midpointToSinksMap.ContainsKey(midpointKey))
|
||||
midpointToSinksMap[midpointKey] = new HashSet<string>();
|
||||
|
||||
|
|
@ -115,7 +118,8 @@ namespace PepperDash.Essentials.Core.Routing
|
|||
|
||||
if (tieLine.SourcePort.ParentDevice is IRoutingWithFeedback midpoint)
|
||||
{
|
||||
midpoints.Add(midpoint.Key);
|
||||
if (!string.IsNullOrEmpty(midpoint.Key))
|
||||
midpoints.Add(midpoint.Key);
|
||||
|
||||
// Find upstream TieLines connected to this midpoint's inputs
|
||||
var midpointInputs = (midpoint as IRoutingInputs)?.InputPorts;
|
||||
|
|
@ -244,6 +248,9 @@ namespace PepperDash.Essentials.Core.Routing
|
|||
var upstreamMidpoints = GetUpstreamMidpoints(sink);
|
||||
foreach (var midpointKey in upstreamMidpoints)
|
||||
{
|
||||
if (string.IsNullOrEmpty(midpointKey))
|
||||
continue;
|
||||
|
||||
if (!midpointToSinksMap.ContainsKey(midpointKey))
|
||||
midpointToSinksMap[midpointKey] = new HashSet<string>();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue