From 044654b5a9db3d7b81b8bfc24eeb55d262a23631 Mon Sep 17 00:00:00 2001 From: Cinder Date: Sat, 13 Jun 2015 12:36:32 -0600 Subject: Guard against scenes without an agent prefs service and a copy and paste fix Signed-off-by: Diva Canto --- OpenSim/Region/ClientStack/Linden/Caps/AgentPreferencesModule.cs | 7 +++++++ .../AgentPreferences/LocalAgentPreferencesServiceConnector.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/AgentPreferencesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/AgentPreferencesModule.cs index 9f65dbf..fcc260f 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/AgentPreferencesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/AgentPreferencesModule.cs @@ -118,6 +118,13 @@ namespace OpenSim.Region.ClientStack.LindenCaps public string UpdateAgentPreferences(string request, string path, string param, UUID agent) { + // The viewer doesn't do much with the return value, so for now, if there is no preference service, + // we'll return a null llsd block for debugging purposes. This may change if someone knows what the + // correct server response would be here. + if (m_scenes[0].AgentPreferencesService == null) + { + return ""; + } m_log.DebugFormat("[AgentPrefs]: UpdateAgentPreferences for {0}", agent.ToString()); OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); AgentPrefs data = m_scenes[0].AgentPreferencesService.GetAgentPreferences(agent); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs index 9d8367d..41ae53f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.AgentPreferences if (m_AgentPreferencesService == null) { - m_log.Error("[AGENT PREFERENCES CONNECTOR]: Can't load user account service"); + m_log.Error("[AGENT PREFERENCES CONNECTOR]: Can't load agent preferences service"); return; } m_Enabled = true; -- cgit v1.1