Fix mantis #6170 - Check if first argument of PRIM_TEXT is string or key

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
This commit is contained in:
Kevin Cozens
2023-03-14 14:16:06 -04:00
committed by UbitUmarov
parent c9281979c0
commit e40fe91966

View File

@@ -10155,14 +10155,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_Vector primTextColor; LSL_Vector primTextColor;
LSL_Float primTextAlpha; LSL_Float primTextAlpha;
try object o = rules.Data[idx];
{ if (o is LSL_Types.LSLString || o is LSL_Types.key)
primText = rules.GetLSLStringItem(idx++); primText = rules.GetLSLStringItem(idx++);
} else
catch(InvalidCastException)
{ {
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXT: arg #{1} - parameter 2 must be string", rulesParsed, idx - idxStart - 1)); //throw new InvalidCastException(string.Format("Error running rule #{0} -> PRIM_TEXT: arg #{1} - parameter 2 must be string", rulesParsed, idx - idxStart - 1));
return new LSL_List(); Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXT: arg #{1} - parameter 2 must be string", rulesParsed, idx - idxStart - 1));
return new LSL_List();
} }
try try
{ {