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

avinationmerge
Melanie 2011-01-11 14:59:55 +01:00
parent 2c6a410e90
commit d8fd777e13
1 changed files with 1 additions and 1 deletions

View File

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