From 538f51f36d6e41d556d9e65230ccdaaaa220e224 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 29 Sep 2008 10:30:01 +0000 Subject: Mantis #2293 Fix a null reference exception when the exception thrown by a script is not a TargetInvocationException --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index aa9ace4..dcf3043 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -825,6 +825,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance string FormatException(Exception e) { + if (e.InnerException == null) // Not a normal runtime error + return e.ToString(); + string message = "Runtime error:\n" + e.InnerException.StackTrace; string[] lines = message.Split(new char[] {'\n'}); -- cgit v1.1