From dedc1baeb7f77afa292b851efd73aeae955ac725 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Mon, 6 Oct 2008 00:51:36 +0000 Subject: [PATCH] Mantis#2336. Thank you kindly, Ralphos for a patch that: Prevent EventAbortException inner exceptions of TargetInvocationException being re-thrown from OpenSim.Region.ScriptEngine.Shared.ScriptBase. Executor.ExecuteEvent --- .../ScriptEngine/Shared/Api/Runtime/Executor.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs index 90598c16fd..43e3f3c505 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs @@ -191,14 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase //Console.WriteLine("ScriptEngine: Executing function name: " + EventName); #endif // Found - try + try { ev.Invoke(m_Script, args); } catch (TargetInvocationException tie) { - // Grab the inner exception and rethrow it - throw tie.InnerException; + // Grab the inner exception and rethrow it, unless the inner + // exception is an EventAbortException as this indicates event + // invokation termination due to a state change. + if ( !(tie.InnerException is EventAbortException) ) + { + throw tie.InnerException; + } } catch (Exception e) {