+2005-05-31 Lluis Sanchez Gual <lluis@novell.com>
+
+ * ReturnMessage.cs: Added some null checks.
+ * MethodReturnMessageWrapper.cs: Added some null checks. Fixed
+ incorrect cast in the constructor.
+
2005-05-20 Sebastien Pouliot <sebastien@ximian.com>
* AsyncResult.cs: Added new fields (required for stack propagation) to
public MethodReturnMessageWrapper (IMethodReturnMessage msg)
: base (msg)
{
- _args = ((IMethodCallMessage)WrappedMessage).Args;
- _exception = msg.Exception;
- _outArgInfo = new ArgInfo (msg.MethodBase, ArgInfoType.Out);
+ if (msg.Exception != null) {
+ _exception = msg.Exception;
+ _args = new object[0];
+ } else {
+ _args = msg.Args;
+ _return = msg.ReturnValue;
+ if (msg.MethodBase != null)
+ _outArgInfo = new ArgInfo (msg.MethodBase, ArgInfoType.Out);
+ }
}
public virtual int ArgCount {
}
public virtual int OutArgCount {
- get { return _outArgInfo.GetInOutArgCount(); }
+ get { return _outArgInfo != null ? _outArgInfo.GetInOutArgCount() : 0; }
}
public virtual object[] OutArgs {
- get { return _outArgInfo.GetInOutArgs (_args); }
+ get { return _outArgInfo != null ? _outArgInfo.GetInOutArgs (_args) : _args; }
}
public virtual IDictionary Properties
_args = outArgs;
_outArgsCount = outArgCount;
_callCtx = callCtx;
- _uri = request.Uri;
- _methodBase = request.MethodBase;
+ if (request != null) {
+ _uri = request.Uri;
+ _methodBase = request.MethodBase;
+ }
if (_args == null) _args = new object [outArgCount];
}
public bool HasVarArgs {
get {
- return (MethodBase.CallingConvention | CallingConventions.VarArgs) != 0;
+ if (_methodBase == null) return false;
+ else return (_methodBase.CallingConvention | CallingConventions.VarArgs) != 0;
}
}