mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
handle null refs on llSubStringIndex()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user