fix: prevent processing of null or empty midpoint keys in RoutingFeedbackManager

This commit is contained in:
Neil Dorin 2026-05-22 09:48:12 -06:00
parent f658fdf363
commit abef1d095f

View file

@ -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,6 +118,7 @@ namespace PepperDash.Essentials.Core.Routing
if (tieLine.SourcePort.ParentDevice is IRoutingWithFeedback midpoint)
{
if (!string.IsNullOrEmpty(midpoint.Key))
midpoints.Add(midpoint.Key);
// Find upstream TieLines connected to this midpoint's inputs
@ -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>();