From a91f32e2c739edfce310a4baa43b7256e1a8fa9f Mon Sep 17 00:00:00 2001 From: Cinder Date: Sun, 21 Jun 2015 08:09:41 -0600 Subject: [PATCH] Guard against null AgentPrefs service in llGetAgentLanguage() Signed-off-by: Diva Canto --- .../Shared/Api/Implementation/LSL_Api.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 75b40af229..fa762a6e81 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6149,10 +6149,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // This should only return a value if the avatar is in the same region, but eh. idc. m_host.AddScriptLPS(1); - UUID key = new UUID(); - if (UUID.TryParse(id, out key)) + if (World.AgentPreferencesService == null) { - return new LSL_String(World.AgentPreferencesService.GetLang(key)); + Error("llGetAgentLanguage", "No AgentPreferencesService present"); + } + else + { + UUID key = new UUID(); + if (UUID.TryParse(id, out key)) + { + return new LSL_String(World.AgentPreferencesService.GetLang(key)); + } } return new LSL_String("en-us"); }