handle null refs on llSubStringIndex()

0.9.1.1
UbitUmarov 2019-11-06 23:40:53 +00:00
parent 926e4ea95e
commit 8ed0680bb9
1 changed files with 4 additions and 0 deletions

View File

@ -5846,6 +5846,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llSubStringIndex(string source, string pattern)
{
m_host.AddScriptLPS(1);
if (string.IsNullOrEmpty(source))
return -1;
if (string.IsNullOrEmpty(pattern))
return 0;
return source.IndexOf(pattern);
}