Use ToString() rather than a cast (more robust)

viewer-2-initial-appearance
Melanie 2011-01-11 14:59:55 +01:00
parent 7cfe17b5b3
commit f75a3ee762
1 changed files with 1 additions and 1 deletions

View File

@ -558,7 +558,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
else if (m_data[itemIndex] is Int32)
return new LSLInteger((int)m_data[itemIndex]);
else if (m_data[itemIndex] is LSL_Types.LSLString)
return new LSLInteger((string)m_data[itemIndex]);
return new LSLInteger(m_data[itemIndex].ToString());
else
throw new InvalidCastException();
}