avoid null ref

master
UbitUmarov 2020-05-15 18:17:13 +01:00
parent c0597e278b
commit 7098091616
2 changed files with 75 additions and 67 deletions

View File

@ -6548,7 +6548,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LandData landData = lo.LandData; LandData landData = lo.LandData;
IPrimCounts pc = lo.PrimCounts; IPrimCounts pc = lo.PrimCounts;
StringBuilder sb = eq.StartEvent("ParcelProperties"); int cap = 4 * landData.Bitmap.Length / 3 + 2048;
StringBuilder sb = eq.StartEvent("ParcelProperties", cap);
LLSDxmlEncode.AddArrayAndMap("ParcelData", sb); LLSDxmlEncode.AddArrayAndMap("ParcelData", sb);

View File

@ -6586,9 +6586,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0; return 0;
} }
if (agent.IsChildAgent) if (agent.IsChildAgent || agent.IsDeleted)
return 0; // Fail if they are not in the same region return 0; // Fail if they are not in the same region
try
{
// note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL // note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL
if (agent.SetAlwaysRun) if (agent.SetAlwaysRun)
{ {
@ -6671,6 +6673,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
flags |= ScriptBaseClass.AGENT_MALE; flags |= ScriptBaseClass.AGENT_MALE;
} }
}
catch
{
return 0;
}
return flags; return flags;
} }