mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-10 21:33:46 +00:00
Fixed exception when agent does not have capabilities field.
This commit is contained in:
@@ -399,7 +399,7 @@ namespace MeshCentralRouter
|
|||||||
if (node.ContainsKey("agent"))
|
if (node.ContainsKey("agent"))
|
||||||
{
|
{
|
||||||
n.agentid = (int)((Dictionary<string, object>)node["agent"])["id"];
|
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"]; }
|
if (node.ContainsKey("conn")) { n.conn = (int)node["conn"]; }
|
||||||
n.icon = 1;
|
n.icon = 1;
|
||||||
@@ -541,7 +541,7 @@ namespace MeshCentralRouter
|
|||||||
if (node.ContainsKey("agent"))
|
if (node.ContainsKey("agent"))
|
||||||
{
|
{
|
||||||
n.agentid = (int)((Dictionary<string, object>)node["agent"])["id"];
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -588,7 +588,7 @@ namespace MeshCentralRouter
|
|||||||
if (node.ContainsKey("agent"))
|
if (node.ContainsKey("agent"))
|
||||||
{
|
{
|
||||||
n.agentid = (int)((Dictionary<string, object>)node["agent"])["id"];
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user