From d0eecf03986b1b1bd7458123a2deed522587b6dc Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 21 May 2010 14:17:03 -0700 Subject: Added a sanity check before using m_config in the Scene constructor --- OpenSim/Region/Framework/Scenes/Scene.cs | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f35dffc..46fbcd3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -794,25 +794,28 @@ namespace OpenSim.Region.Framework.Scenes #region Interest Management - IConfig interestConfig = m_config.Configs["InterestManagement"]; - if (interestConfig != null) + if (m_config != null) { - string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); - - try + IConfig interestConfig = m_config.Configs["InterestManagement"]; + if (interestConfig != null) { - m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); - } - catch (Exception) - { - m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); - m_priorityScheme = UpdatePrioritizationSchemes.Time; - } + string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); - m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); - m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); - m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); - m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0); + try + { + m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); + } + catch (Exception) + { + m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); + m_priorityScheme = UpdatePrioritizationSchemes.Time; + } + + m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); + m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); + m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); + m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0); + } } m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme"); -- cgit v1.1