handle null refs on llSubStringIndex()
parent
926e4ea95e
commit
8ed0680bb9
|
@ -5846,6 +5846,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_Integer llSubStringIndex(string source, string pattern)
|
public LSL_Integer llSubStringIndex(string source, string pattern)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
if (string.IsNullOrEmpty(source))
|
||||||
|
return -1;
|
||||||
|
if (string.IsNullOrEmpty(pattern))
|
||||||
|
return 0;
|
||||||
return source.IndexOf(pattern);
|
return source.IndexOf(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue