aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorCinder2015-06-21 08:09:41 -0600
committerDiva Canto2015-06-21 08:41:37 -0700
commita91f32e2c739edfce310a4baa43b7256e1a8fa9f (patch)
treef3c449ed2a6541d2c313c2f34109773ef0b85bf9 /OpenSim
parentAdd MaxMaterialsPerTransaction to SimFeatures (diff)
downloadopensim-SC-a91f32e2c739edfce310a4baa43b7256e1a8fa9f.zip
opensim-SC-a91f32e2c739edfce310a4baa43b7256e1a8fa9f.tar.gz
opensim-SC-a91f32e2c739edfce310a4baa43b7256e1a8fa9f.tar.bz2
opensim-SC-a91f32e2c739edfce310a4baa43b7256e1a8fa9f.tar.xz
Guard against null AgentPrefs service in llGetAgentLanguage()
Signed-off-by: Diva Canto <diva@metaverseink.com>
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
1 files 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 75b40af..fa762a6 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
6149 { 6149 {
6150 // This should only return a value if the avatar is in the same region, but eh. idc. 6150 // This should only return a value if the avatar is in the same region, but eh. idc.
6151 m_host.AddScriptLPS(1); 6151 m_host.AddScriptLPS(1);
6152 UUID key = new UUID(); 6152 if (World.AgentPreferencesService == null)
6153 if (UUID.TryParse(id, out key))
6154 { 6153 {
6155 return new LSL_String(World.AgentPreferencesService.GetLang(key)); 6154 Error("llGetAgentLanguage", "No AgentPreferencesService present");
6155 }
6156 else
6157 {
6158 UUID key = new UUID();
6159 if (UUID.TryParse(id, out key))
6160 {
6161 return new LSL_String(World.AgentPreferencesService.GetLang(key));
6162 }
6156 } 6163 }
6157 return new LSL_String("en-us"); 6164 return new LSL_String("en-us");
6158 } 6165 }