handle null refs on llSubStringIndex()

This commit is contained in:
UbitUmarov
2019-11-06 23:40:53 +00:00
parent 926e4ea95e
commit 8ed0680bb9

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);
}