From 132b95ec95f209b8b2ba5842ae03baf870cef6d1 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 12 Jul 2008 17:11:43 +0000 Subject: Mantis#1714. Thank you kindly, Krtaylor for a patch that: Solves llGetListLength fails scripts when list is not initialized. --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 10 +++++++++- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 8ae2456..53d1209 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3355,7 +3355,15 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llGetListLength(LSL_Types.list src) { m_host.AddScriptLPS(1); - return src.Length; + + if (src == null) + { + return 0; + } + else + { + return src.Length; + } } public LSL_Types.LSLInteger llList2Integer(LSL_Types.list src, int index) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3fbe257..8edd169 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3299,7 +3299,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.LSLInteger llGetListLength(LSL_Types.list src) { m_host.AddScriptLPS(1); - return src.Length; + + if (src == null) + { + return 0; + } + else + { + return src.Length; + } } public LSL_Types.LSLInteger llList2Integer(LSL_Types.list src, int index) -- cgit v1.1