From c33d15e2dec59301060f817245f7e42eca4dd90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Tue, 27 Mar 2012 13:22:16 +0200 Subject: [PATCH] Fixed bug where code actions could be null. --- .../Ast/GeneralScope/TypeParameterDeclaration.cs | 11 ++++++++++- .../Refactoring/CodeIssue.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs b/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs index a064dcda80..ede85f16a3 100644 --- a/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs +++ b/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs @@ -79,7 +79,16 @@ namespace ICSharpCode.NRefactory.CSharp SetChildByRole (Roles.Identifier, value); } } - + + public TypeParameterDeclaration () + { + } + + public TypeParameterDeclaration (string name) + { + Name = name; + } + public override void AcceptVisitor (IAstVisitor visitor) { visitor.VisitTypeParameterDeclaration (this); diff --git a/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssue.cs b/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssue.cs index 20f374cf48..435ed304f6 100644 --- a/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssue.cs +++ b/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssue.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring Actions = action ?? Enumerable.Empty (); } - public CodeIssue(string description, TextLocation start, TextLocation end, CodeAction action) : this (description, start, end, new [] { action }) + public CodeIssue(string description, TextLocation start, TextLocation end, CodeAction action) : this (description, start, end, action != null ? new [] { action } : null) { } }