From b920f784eae523af5b97825fc92bb61e8120cde3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 1 Jun 2017 00:14:59 +0100 Subject: [PATCH] avoi null refs on tests simple clients --- .../EntityTransfer/EntityTransferModule.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index bcf4322607..99bebdd061 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -844,9 +844,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); List childRegionsToClose = sp.GetChildAgentsToClose(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY); - foreach(ulong handler in childRegionsToClose) + if(agentCircuit.ChildrenCapSeeds != null) { - agentCircuit.ChildrenCapSeeds.Remove(handler); + foreach(ulong handler in childRegionsToClose) + { + agentCircuit.ChildrenCapSeeds.Remove(handler); + } } // Let's create an agent there if one doesn't exist yet. @@ -1084,9 +1087,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer ulong destinationHandle = finalDestination.RegionHandle; List childRegionsToClose = sp.GetChildAgentsToClose(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY); - foreach(ulong handler in childRegionsToClose) + + if(agentCircuit.ChildrenCapSeeds != null) { - agentCircuit.ChildrenCapSeeds.Remove(handler); + foreach(ulong handler in childRegionsToClose) + { + agentCircuit.ChildrenCapSeeds.Remove(handler); + } } string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; @@ -1763,8 +1770,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer cAgent.ChildrenCapSeeds = agent.KnownRegions; childRegionsToClose = agent.GetChildAgentsToClose(neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); - foreach(ulong regh in childRegionsToClose) - cAgent.ChildrenCapSeeds.Remove(regh); + if(cAgent.ChildrenCapSeeds != null) + { + foreach(ulong regh in childRegionsToClose) + cAgent.ChildrenCapSeeds.Remove(regh); + } if (isFlying) cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;