1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-06 00:13:33 +00:00

Fixed exception when agent does not have capabilities field.

This commit is contained in:
Ylian Saint-Hilaire
2022-01-31 12:45:54 -08:00
parent 2c66ddc2c2
commit 5e0a9ae108

View File

@@ -399,7 +399,7 @@ namespace MeshCentralRouter
if (node.ContainsKey("agent"))
{
n.agentid = (int)((Dictionary<string, object>)node["agent"])["id"];
n.agentcaps = (int)((Dictionary<string, object>)node["agent"])["caps"];
if (((Dictionary<string, object>)node["agent"]).ContainsKey("caps")) { n.agentcaps = (int)((Dictionary<string, object>)node["agent"])["caps"]; } else { n.agentcaps = 0; }
}
if (node.ContainsKey("conn")) { n.conn = (int)node["conn"]; }
n.icon = 1;
@@ -541,7 +541,7 @@ namespace MeshCentralRouter
if (node.ContainsKey("agent"))
{
n.agentid = (int)((Dictionary<string, object>)node["agent"])["id"];
n.agentcaps = (int)((Dictionary<string, object>)node["agent"])["caps"];
if (((Dictionary<string, object>)node["agent"]).ContainsKey("caps")) { n.agentcaps = (int)((Dictionary<string, object>)node["agent"])["caps"]; } else { n.agentcaps = 0; }
}
else
{
@@ -588,7 +588,7 @@ namespace MeshCentralRouter
if (node.ContainsKey("agent"))
{
n.agentid = (int)((Dictionary<string, object>)node["agent"])["id"];
n.agentcaps = (int)((Dictionary<string, object>)node["agent"])["caps"];
if (((Dictionary<string, object>)node["agent"]).ContainsKey("caps")) { n.agentcaps = (int)((Dictionary<string, object>)node["agent"])["caps"]; } else { n.agentcaps = 0; }
}
else
{