mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
remove necessity to catch a KeyNotFoundException in BaseHttpServer.RemoveLLSDHandler()
This commit is contained in:
@@ -1853,21 +1853,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
public bool RemoveLLSDHandler(string path, LLSDMethod handler)
|
||||
{
|
||||
try
|
||||
lock (m_llsdHandlers)
|
||||
{
|
||||
lock (m_llsdHandlers)
|
||||
LLSDMethod foundHandler;
|
||||
|
||||
if (m_llsdHandlers.TryGetValue(path, out foundHandler) && foundHandler == handler)
|
||||
{
|
||||
if (handler == m_llsdHandlers[path])
|
||||
{
|
||||
m_llsdHandlers.Remove(path);
|
||||
return true;
|
||||
}
|
||||
m_llsdHandlers.Remove(path);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
// This is an exception to prevent crashing because of invalid code
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user