Add support for void return type

avinationmerge
root 2013-03-03 22:50:20 +01:00
parent 1ef50fef44
commit 82ac1763fb
1 changed files with 5 additions and 1 deletions

View File

@ -123,7 +123,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void modInvokeN(string fname, params object[] parms) public void modInvokeN(string fname, params object[] parms)
{ {
Type returntype = m_comms.LookupReturnType(fname); Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(string)) if (returntype != typeof(void))
MODError(String.Format("return type mismatch for {0}",fname)); MODError(String.Format("return type mismatch for {0}",fname));
modInvoke(fname,parms); modInvoke(fname,parms);
@ -264,6 +264,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (result != null) if (result != null)
return result; return result;
Type returntype = m_comms.LookupReturnType(fname);
if (returntype == typeof(void))
return null;
MODError(String.Format("Invocation of {0} failed; null return value",fname)); MODError(String.Format("Invocation of {0} failed; null return value",fname));
} }
catch (Exception e) catch (Exception e)