improve llOverMyLand() handling of potencial null refs. ty mrieker

httptests
UbitUmarov 2018-06-09 20:44:38 +01:00
parent a48d65fd77
commit 76a82ba5de
1 changed files with 14 additions and 12 deletions

View File

@ -6895,6 +6895,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
UUID key = new UUID();
if (UUID.TryParse(id, out key))
{
try
{
ScenePresence presence = World.GetScenePresence(key);
if (presence != null) // object is an avatar
@ -6906,12 +6908,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
SceneObjectPart obj = World.GetSceneObjectPart(key);
if (obj != null)
{
if (m_host.OwnerID == World.LandChannel.GetLandObject(obj.AbsolutePosition).LandData.OwnerID)
if (obj != null &&
m_host.OwnerID == World.LandChannel.GetLandObject(obj.AbsolutePosition).LandData.OwnerID)
return 1;
}
}
catch { }
}
return 0;
@ -14780,7 +14782,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
}
string data = Encoding.UTF8.GetString(a.Data);
//string data = Encoding.UTF8.GetString(a.Data);
//m_log.Debug(data);
NotecardCache.Cache(id, a.Data);
AsyncCommands.DataserverPlugin.DataserverReply(