Browse Source

Added some null checks.

pull/32/merge
Mike Krüger 13 years ago
parent
commit
91ee675380
  1. 4
      ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/StatementsToInitializerConverter.cs

4
ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/ConvertToInitializer/StatementsToInitializerConverter.cs

@ -357,7 +357,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -357,7 +357,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
bool VariableHasBeenConverted(IVariable variable)
{
return accessPaths.Any(item => item.Key.VariableRoot.Equals(variable));
if (variable == null)
throw new ArgumentNullException("variable");
return accessPaths.Any(item => item.Key != null && item.Key.VariableRoot != null && item.Key.VariableRoot.Equals(variable));
}
bool InsertImplicitInitializersForPath(AccessPath path)

Loading…
Cancel
Save