minor: In "show client stats" command, properly handle the case where a client has made no AgentUpdate requests (as is the case with agents that have only even been child) rather than throwing an exception

ghosts
Justin Clark-Casey (justincc) 2014-10-24 21:51:27 +01:00
parent a17bbeca9d
commit 27efecc82f
1 changed files with 3 additions and 1 deletions

View File

@ -603,7 +603,9 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
string.Format(
"{0} ({1:0.00}%)",
llClient.TotalAgentUpdates,
(float)cinfo.SyncRequests["AgentUpdate"] / llClient.TotalAgentUpdates * 100));
cinfo.SyncRequests.ContainsKey("AgentUpdate")
? (float)cinfo.SyncRequests["AgentUpdate"] / llClient.TotalAgentUpdates * 100
: 0));
}
});
}