From 76106e39d9cd48f136caf061ef9d19641bbdfd31 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 15 Mar 2010 19:34:14 -0700 Subject: Restoring LoadPlugin as it was before. Justin's last change made it throw. --- OpenSim/Server/Base/ServerUtils.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Server/Base/ServerUtils.cs') diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index a399672..e7a8294 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -101,10 +101,23 @@ namespace OpenSim.Server.Base continue; Type typeInterface = pluginType.GetInterface(interfaceName, true); - + if (typeInterface != null) { - return (T)Activator.CreateInstance(pluginType, args); + T plug = null; + try + { + plug = (T)Activator.CreateInstance(pluginType, + args); + } + catch (Exception e) + { + if (!(e is System.MissingMethodException)) + m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException); + return null; + } + + return plug; } } } -- cgit v1.1