improve llOverMyLand() handling of potencial null refs. ty mrieker
parent
a48d65fd77
commit
76a82ba5de
|
@ -6896,22 +6896,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID key = new UUID();
|
UUID key = new UUID();
|
||||||
if (UUID.TryParse(id, out key))
|
if (UUID.TryParse(id, out key))
|
||||||
{
|
{
|
||||||
ScenePresence presence = World.GetScenePresence(key);
|
try
|
||||||
if (presence != null) // object is an avatar
|
|
||||||
{
|
{
|
||||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
|
ScenePresence presence = World.GetScenePresence(key);
|
||||||
return 1;
|
if (presence != null) // object is an avatar
|
||||||
}
|
|
||||||
else // object is not an avatar
|
|
||||||
{
|
|
||||||
SceneObjectPart obj = World.GetSceneObjectPart(key);
|
|
||||||
|
|
||||||
if (obj != null)
|
|
||||||
{
|
{
|
||||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(obj.AbsolutePosition).LandData.OwnerID)
|
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else // object is not an avatar
|
||||||
|
{
|
||||||
|
SceneObjectPart obj = World.GetSceneObjectPart(key);
|
||||||
|
|
||||||
|
if (obj != null &&
|
||||||
|
m_host.OwnerID == World.LandChannel.GetLandObject(obj.AbsolutePosition).LandData.OwnerID)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -14780,7 +14782,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string data = Encoding.UTF8.GetString(a.Data);
|
//string data = Encoding.UTF8.GetString(a.Data);
|
||||||
//m_log.Debug(data);
|
//m_log.Debug(data);
|
||||||
NotecardCache.Cache(id, a.Data);
|
NotecardCache.Cache(id, a.Data);
|
||||||
AsyncCommands.DataserverPlugin.DataserverReply(
|
AsyncCommands.DataserverPlugin.DataserverReply(
|
||||||
|
|
Loading…
Reference in New Issue