From e647623199ae8710873f49f2a2c93f2f01a00fd7 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 5 Apr 2011 20:51:44 +0200 Subject: [PATCH] Fixed SD-1817 - NullReferenceException in C# OverloadResolution when editing signature of generic method with 'params' --- .../Project/Src/CSharp/OverloadResolution.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/OverloadResolution.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/OverloadResolution.cs index 8964fa9cbf..81add2c1a9 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/OverloadResolution.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/OverloadResolution.cs @@ -104,7 +104,7 @@ namespace ICSharpCode.SharpDevelop.Dom.CSharp if (candidate.Status == CandidateStatus.Success) { if (candidate.Parameters.Count > 0 && arguments.Count >= candidate.Parameters.Count - 1) { IParameter lastParameter = candidate.Parameters[candidate.Parameters.Count - 1]; - if (lastParameter.IsParams && lastParameter.ReturnType.IsArrayReturnType) { + if (lastParameter.IsParams && lastParameter.ReturnType != null && lastParameter.ReturnType.IsArrayReturnType) { // try to construct an expanded form with the correct parameter count IReturnType elementType = lastParameter.ReturnType.CastToArrayReturnType().ArrayElementType; IMethodOrProperty expanded = (IMethodOrProperty)candidate.Method.CreateSpecializedMember();