From 548abb3b47957bc064706859aff8ebb7333357d2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 24 Oct 2014 21:51:27 +0100 Subject: 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 --- .../Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index cc6a1e8..f6772a5 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -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)); } }); } -- cgit v1.1