From badcbd4beaaa8e4f1f087d55622bf8c5cb947642 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 18 Dec 2007 01:49:21 +0000 Subject: * Fixed a potential race condition with adding Caps handlers --- OpenSim/Region/Environment/Scenes/Scene.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ac37fdd..81b0919 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1334,7 +1334,15 @@ namespace OpenSim.Region.Environment.Scenes { //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + // agent.AgentID.ToStringHyphenated()); - m_capsHandlers[agent.AgentID] = cap; + try + { + m_capsHandlers[agent.AgentID] = cap; + } + catch (System.Collections.Generic.KeyNotFoundException) + { + // Fix for a potential race condition. + m_capsHandlers.Add(agent.AgentID, cap); + } } else { -- cgit v1.1