From da68f18a6be3836e573dab7ff08e2ae7f90e2608 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 11 Jul 2008 17:58:26 +0000 Subject: * Guard against a null point passed to RemoveClientCircuit (odd that this happens at all) * Patch from Kurt Taylor (IBM) in http://opensimulator.org/mantis/view.php?id=1720 * Thanks Kurt! --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index d705ef2..570ebe9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -474,15 +474,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP public virtual void RemoveClientCircuit(uint circuitcode) { EndPoint sendto = null; - if (clientCircuits_reverse.Contains(circuitcode)) { + if (clientCircuits_reverse.Contains(circuitcode)) + { sendto = (EndPoint)clientCircuits_reverse[circuitcode]; clientCircuits_reverse.Remove(circuitcode); - lock (clientCircuits) { - clientCircuits.Remove(sendto); + lock (clientCircuits) + { + if (sendto != null) + { + clientCircuits.Remove(sendto); + } + else + { + m_log.DebugFormat( + "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); + } } - lock (proxyCircuits) { + lock (proxyCircuits) + { proxyCircuits.Remove(circuitcode); } } -- cgit v1.1