From: Kurt Taylor <krtaylor@us.ibm.com>

Attached is the second half of the fix for 821 - this is the null reference
check for llDetectedName and the other *Detected* function.
0.6.0-stable
Sean Dague 2008-04-11 13:51:11 +00:00
parent cbf9fcfac5
commit f337cb205d
1 changed files with 16 additions and 11 deletions

View File

@ -434,12 +434,14 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LSL_Types.list SenseList = m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.GetSensorList(m_localID, m_itemID); LSL_Types.list SenseList = m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.GetSensorList(m_localID, m_itemID);
if (SenseList != null)
{
if ((number >= 0) && (number <= SenseList.Length)) if ((number >= 0) && (number <= SenseList.Length))
{ {
LLUUID SensedUUID = (LLUUID)SenseList.Data[number]; LLUUID SensedUUID = (LLUUID)SenseList.Data[number];
return resolveName(SensedUUID); return resolveName(SensedUUID);
} }
else }
return String.Empty; return String.Empty;
} }
@ -479,6 +481,8 @@ namespace OpenSim.Region.ScriptEngine.Common
public EntityBase entityDetectedKey(int number) public EntityBase entityDetectedKey(int number)
{ {
LSL_Types.list SenseList = m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.GetSensorList(m_localID, m_itemID); LSL_Types.list SenseList = m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.GetSensorList(m_localID, m_itemID);
if (SenseList != null)
{
if ((number >= 0) && (number < SenseList.Length)) if ((number >= 0) && (number < SenseList.Length))
{ {
LLUUID SensedUUID = (LLUUID)SenseList.Data[number]; LLUUID SensedUUID = (LLUUID)SenseList.Data[number];
@ -489,6 +493,7 @@ namespace OpenSim.Region.ScriptEngine.Common
} }
return SensedObject; return SensedObject;
} }
}
return null; return null;
} }