From f931c0a86893799548d1d0f72c327c37823e4612 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 15:04:41 -0700 Subject: [PATCH] Minor: may avoid crashes of sims that still don't have this configuration section. --- OpenSim/Framework/AssetPermissions.cs | 3 +++ .../CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/AssetPermissions.cs b/OpenSim/Framework/AssetPermissions.cs index d276def389..4a905c2f5d 100644 --- a/OpenSim/Framework/AssetPermissions.cs +++ b/OpenSim/Framework/AssetPermissions.cs @@ -35,6 +35,9 @@ namespace OpenSim.Framework private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray) { + if (assetConfig == null) + return; + string perms = assetConfig.GetString(variable, String.Empty); string[] parts = perms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string s in parts) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 04568525f0..1e1c7d00e0 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); IConfig hgConfig = source.Configs["HGAssetService"]; - m_AssetPerms = new AssetPermissions(hgConfig); + m_AssetPerms = new AssetPermissions(hgConfig); // it's ok if arg is null m_Enabled = true; m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");