From e9e5c175cd6a31ea4cec6bcdcca9a4a21acedee4 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Mon, 23 Feb 2009 23:14:04 +0000 Subject: [PATCH] Thank you kindly, TLaukkan (Tommil) for a patch that solves: If -background=true is specified on the command line, a null pointer exception crashes the server in OpenSim/Region/Application/OpenSimBase.cs in method StartupSpecific. Its trying to dereference m_console which is null, presumably because we're in background mode. --- OpenSim/Region/Application/OpenSimBase.cs | 61 ++++++++++++----------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index ad7d06fa13..f3e3d4f71a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -198,41 +198,46 @@ namespace OpenSim // Only enable logins to the regions once we have completely finished starting up (apart from scripts) m_commsManager.GridService.RegionLoginsEnabled = true; - List topics = GetHelpTopics(); - - foreach (string topic in topics) + // If console exists add plugin commands. + if (m_console != null) { - m_console.Commands.AddCommand("plugin", false, "help " + topic, - "help " + topic, - "Get help on plugin command '" + topic + "'", - HandleCommanderHelp); + List topics = GetHelpTopics(); - m_console.Commands.AddCommand("plugin", false, topic, - topic, - "Execute subcommand for plugin '" + topic + "'", - null); - - ICommander commander = null; - - Scene s = SceneManager.CurrentOrFirstScene; - - if (s != null && s.GetCommanders() != null) + foreach (string topic in topics) { - if (s.GetCommanders().ContainsKey(topic)) - commander = s.GetCommanders()[topic]; - } + m_console.Commands.AddCommand("plugin", false, "help " + topic, + "help " + topic, + "Get help on plugin command '" + topic + "'", + HandleCommanderHelp); - if (commander == null) - continue; + m_console.Commands.AddCommand("plugin", false, topic, + topic, + "Execute subcommand for plugin '" + topic + "'", + null); - foreach (string command in commander.Commands.Keys) - { - m_console.Commands.AddCommand(topic, false, - topic + " " + command, - topic + " " + commander.Commands[command].ShortHelp(), - String.Empty, HandleCommanderCommand); + ICommander commander = null; + + Scene s = SceneManager.CurrentOrFirstScene; + + if (s != null && s.GetCommanders() != null) + { + if (s.GetCommanders().ContainsKey(topic)) + commander = s.GetCommanders()[topic]; + } + + if (commander == null) + continue; + + foreach (string command in commander.Commands.Keys) + { + m_console.Commands.AddCommand(topic, false, + topic + " " + command, + topic + " " + commander.Commands[command].ShortHelp(), + String.Empty, HandleCommanderCommand); + } } } + } private void HandleCommanderCommand(string module, string[] cmd)