Skip to content

Commit

Permalink
fix: rework setting custom join data
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrew-welker committed Aug 21, 2023
1 parent da4070b commit 4d2ce83
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,17 @@ public void SetCustomJoinData(Dictionary<string, JoinData> joinData)
{
foreach (var customJoinData in joinData)
{
var join = Joins[customJoinData.Key];
JoinDataComplete join;

if (join != null)
if (!Joins.TryGetValue(customJoinData.Key, out join))
{
join.SetCustomJoinData(customJoinData.Value);
Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
continue;
}
else

if (join != null)
{
Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
join.SetCustomJoinData(customJoinData.Value);
}
}

Expand Down

0 comments on commit 4d2ce83

Please sign in to comment.