diff --git a/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs b/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs index 6968c9675f..10cc5ae3f6 100644 --- a/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs +++ b/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs @@ -112,7 +112,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring public override bool Equals(object obj) { - if (obj.GetType() != typeof(AccessPath)) + if (obj == null || obj.GetType() != typeof(AccessPath)) return false; var other = (AccessPath)obj;