diff options
author | UbitUmarov | 2019-11-06 23:40:53 +0000 |
---|---|---|
committer | UbitUmarov | 2019-11-06 23:40:53 +0000 |
commit | 8ed0680bb9726a2290b1df644f46df30048fc67d (patch) | |
tree | 218ecaa77049cf51fa0063ca7d423ec742f44325 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | mantis 8624: replace native code libs for Mac by ones signed by Geir Nøkleby... (diff) | |
download | opensim-SC-8ed0680bb9726a2290b1df644f46df30048fc67d.zip opensim-SC-8ed0680bb9726a2290b1df644f46df30048fc67d.tar.gz opensim-SC-8ed0680bb9726a2290b1df644f46df30048fc67d.tar.bz2 opensim-SC-8ed0680bb9726a2290b1df644f46df30048fc67d.tar.xz |
handle null refs on llSubStringIndex()
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8ddd175..d4cbbce 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5846,6 +5846,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5846 | public LSL_Integer llSubStringIndex(string source, string pattern) | 5846 | public LSL_Integer llSubStringIndex(string source, string pattern) |
5847 | { | 5847 | { |
5848 | m_host.AddScriptLPS(1); | 5848 | m_host.AddScriptLPS(1); |
5849 | if (string.IsNullOrEmpty(source)) | ||
5850 | return -1; | ||
5851 | if (string.IsNullOrEmpty(pattern)) | ||
5852 | return 0; | ||
5849 | return source.IndexOf(pattern); | 5853 | return source.IndexOf(pattern); |
5850 | } | 5854 | } |
5851 | 5855 | ||