diff --git a/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs b/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs index 0938d9f0c3..3c692706d1 100644 --- a/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs +++ b/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs @@ -113,17 +113,18 @@ namespace ICSharpCode.NRefactory.CSharp public static Identifier Create (string name, TextLocation location) { - if (name == null) - throw new ArgumentNullException("name"); - if (name.Length > 0 && name[0] == '@') + if (string.IsNullOrEmpty(name)) + return Identifier.Null; + if (name[0] == '@') return new VerbatimIdentifier(name.Substring (1), location); - return new Identifier (name, location); + else + return new Identifier (name, location); } public static Identifier Create (string name, TextLocation location, bool isVerbatim) { - if (name == null) - throw new ArgumentNullException("name"); + if (string.IsNullOrEmpty(name)) + return Identifier.Null; if (isVerbatim) return new VerbatimIdentifier(name, location);