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

mb-throttle-test
Justin Clark-Casey (justincc) 2014-10-24 21:51:27 +01:00
parent a9dde81753
commit 548abb3b47
1 changed files with 3 additions and 1 deletions

View File

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