From 4d2ce83e7503dcdc1f82b6b10012f2b8abf3c84f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 21 Aug 2023 15:27:25 -0600 Subject: [PATCH] fix: rework setting custom join data The previous method was causing an Exception to be thrown if a join didn't exist in the default join map for a device. This exception would prevent other devices from linking to a bridge correctly. This method now allows for join names to not be matched and the method will keep going. --- .../PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs index 60aa6275..12df7f14 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs @@ -356,16 +356,18 @@ namespace PepperDash.Essentials.Core { foreach (var customJoinData in joinData) { - var join = Joins[customJoinData.Key]; + JoinDataComplete join; + + if (!Joins.TryGetValue(customJoinData.Key, out join)) + { + Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key); + continue; + } if (join != null) { join.SetCustomJoinData(customJoinData.Value); } - else - { - Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key); - } } PrintJoinMapInfo();