Protect against null requests

cpu-performance
Diva Canto 2013-07-15 11:37:49 -07:00
parent ac73e70293
commit fbb01bd280
2 changed files with 16 additions and 12 deletions

View File

@ -140,11 +140,13 @@ namespace OpenSim.Region.CoreModules.Framework
Watchdog.UpdateThread(); Watchdog.UpdateThread();
GridRegionRequest request = m_RequestQueue.Dequeue(); GridRegionRequest request = m_RequestQueue.Dequeue();
if (request != null)
{
GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, request.regionID); GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, request.regionID);
if (r != null && r.RegionHandle != 0) if (r != null && r.RegionHandle != 0)
request.client.SendRegionHandle(request.regionID, r.RegionHandle); request.client.SendRegionHandle(request.regionID, r.RegionHandle);
}
} }
} }
} }

View File

@ -681,6 +681,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
Watchdog.UpdateThread(); Watchdog.UpdateThread();
NameRequest request = m_RequestQueue.Dequeue(); NameRequest request = m_RequestQueue.Dequeue();
if (request != null)
{
string[] names; string[] names;
bool foundRealName = TryGetUserNames(request.uuid, out names); bool foundRealName = TryGetUserNames(request.uuid, out names);
@ -691,7 +693,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
request.client.SendNameReply(request.uuid, names[0], names[1]); request.client.SendNameReply(request.uuid, names[0], names[1]);
} }
}
} }
} }