mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
avoid null ref
This commit is contained in:
@@ -1412,6 +1412,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm, Vector3 lookAt)
|
||||
{
|
||||
if (lm == null || lm.Data == null || lm.Data.Length == 0)
|
||||
return;
|
||||
|
||||
ScenePresence sp = Scene.GetScenePresence(remoteClient.AgentId);
|
||||
if (sp == null || sp.IsDeleted || sp.IsInTransit || sp.IsChildAgent || sp.IsNPC)
|
||||
return;
|
||||
|
||||
@@ -543,6 +543,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// <param name="position"></param>
|
||||
public override void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm, Vector3 lookAt)
|
||||
{
|
||||
if (lm == null || lm.Data == null || lm.Data.Length == 0)
|
||||
return;
|
||||
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}",
|
||||
(string.IsNullOrEmpty(lm.Gatekeeper)) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position);
|
||||
|
||||
@@ -595,7 +598,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, lm.RegionID, remoteClient.AgentId, homeURI, out string message);
|
||||
if(finalDestination == null)
|
||||
{
|
||||
remoteClient.SendTeleportFailed(message);
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate assorted conditions
|
||||
if (!ValidateGenericConditions(sp, gatekeeper, finalDestination, 0, out string reason))
|
||||
|
||||
Reference in New Issue
Block a user