From 9a4afa753ba4887743bdd4053c336258e7a3fd80 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 30 Jul 2016 20:56:19 +0100 Subject: fix NULL references added in recente changes in standalone mode --- .../ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | 11 +++++++---- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 363adde..21f7567 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs @@ -127,7 +127,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public void PostInitialise() { - ((ISharedRegionModule)m_LocalGridService).PostInitialise(); + if (m_Enabled) + ((ISharedRegionModule)m_LocalGridService).PostInitialise(); } public void Close() @@ -137,14 +138,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public void AddRegion(Scene scene) { if (m_Enabled) + { scene.RegisterModuleInterface(this); - - ((ISharedRegionModule)m_LocalGridService).AddRegion(scene); + ((ISharedRegionModule)m_LocalGridService).AddRegion(scene); + } } public void RemoveRegion(Scene scene) { - ((ISharedRegionModule)m_LocalGridService).RemoveRegion(scene); + if (m_Enabled) + ((ISharedRegionModule)m_LocalGridService).RemoveRegion(scene); } public void RegionLoaded(Scene scene) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c592385..e985903 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4671,9 +4671,10 @@ namespace OpenSim.Region.Framework.Scenes ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; ControllingClient.ActiveGroupPowers = 0; Grouptitle = cAgent.ActiveGroupTitle; - int ngroups = cAgent.Groups.Length; - if(ngroups > 0) + + if(cAgent.Groups != null && cAgent.Groups.Length > 0) { + int ngroups = cAgent.Groups.Length; Dictionary gpowers = new Dictionary(ngroups); for(int i = 0 ; i < ngroups; i++) { -- cgit v1.1