Guard against null AgentPrefs service in llGetAgentLanguage()
Signed-off-by: Diva Canto <diva@metaverseink.com>fsassets
parent
7edaf1d851
commit
a91f32e2c7
|
@ -6149,11 +6149,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
// This should only return a value if the avatar is in the same region, but eh. idc.
|
// This should only return a value if the avatar is in the same region, but eh. idc.
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
if (World.AgentPreferencesService == null)
|
||||||
|
{
|
||||||
|
Error("llGetAgentLanguage", "No AgentPreferencesService present");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
UUID key = new UUID();
|
UUID key = new UUID();
|
||||||
if (UUID.TryParse(id, out key))
|
if (UUID.TryParse(id, out key))
|
||||||
{
|
{
|
||||||
return new LSL_String(World.AgentPreferencesService.GetLang(key));
|
return new LSL_String(World.AgentPreferencesService.GetLang(key));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new LSL_String("en-us");
|
return new LSL_String("en-us");
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue