remove necessity to catch a KeyNotFoundException in BaseHttpServer.RemoveLLSDHandler()
parent
8254116dc6
commit
20a4367827
|
@ -1852,22 +1852,17 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
|
||||
public bool RemoveLLSDHandler(string path, LLSDMethod handler)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (m_llsdHandlers)
|
||||
{
|
||||
if (handler == m_llsdHandlers[path])
|
||||
LLSDMethod foundHandler;
|
||||
|
||||
if (m_llsdHandlers.TryGetValue(path, out foundHandler) && foundHandler == handler)
|
||||
{
|
||||
m_llsdHandlers.Remove(path);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
// This is an exception to prevent crashing because of invalid code
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue