From 9f5e1efc2d2eb9e621e9f517e399acfdefdebeb9 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 3 Dec 2007 09:58:25 +0000 Subject: Added another .ini file error catch to the RemoteAdminPlugin Initialise method. --- .../RemoteController/RemoteAdminPlugin.cs | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 18d5f0c..c37fcba 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -28,18 +28,22 @@ namespace OpenSim.ApplicationPlugins.LoadRegions public void Initialise(OpenSimMain openSim) { - if (openSim.ConfigSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) - { - System.Console.WriteLine("RADMIN","Remote Admin Plugin Enabled"); - - m_app = openSim; - m_httpd = openSim.HttpServer; - - m_httpd.AddXmlRPCHandler("admin_create_region", XmlRpcCreateRegionMethod); - m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod); - m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); - m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); - } + IConfig remoteConfig = openSim.ConfigSource.Configs["RemoteAdmin"]; + if (remoteConfig != null) + { + if (remoteConfig.GetBoolean("enabled", false)) + { + System.Console.WriteLine("RADMIN", "Remote Admin Plugin Enabled"); + + m_app = openSim; + m_httpd = openSim.HttpServer; + + m_httpd.AddXmlRPCHandler("admin_create_region", XmlRpcCreateRegionMethod); + m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod); + m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); + m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); + } + } } public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request) -- cgit v1.1