From da28aada2c19d9e26910c388c031f73d14eeff90 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 15 Nov 2020 13:45:34 +0000 Subject: [PATCH] avoid a null ref in lsl --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index abfde82191..702df20957 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4184,14 +4184,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llStringLength(string str) { m_host.AddScriptLPS(1); - if (str.Length > 0) - { - return str.Length; - } - else - { + if(str == null || str.Length <= 0) return 0; - } + return str.Length; } public void llStartAnimation(string anim)