Browse Source

Fix ArgumentNullException in RedundantCatchClauseIssue.GatherVisitor.IsRedundant()

pull/474/head
Daniel Grunwald 11 years ago
parent
commit
6147f605bb
  1. 5
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCatchClauseIssue.cs

5
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCatchClauseIssue.cs

@ -146,9 +146,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -146,9 +146,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
if (nextClause != null) {
if (nextClause.Type.IsNull && !IsThrowsClause(nextClause))
return false;
if (!IsThrowsClause(nextClause) && type.GetDefinition ().IsDerivedFrom (ctx.Resolve (nextClause.Type).Type.GetDefinition ()))
if (!IsThrowsClause(nextClause)) {
var typeDef = type.GetDefinition();
if (typeDef == null || typeDef.IsDerivedFrom(ctx.Resolve(nextClause.Type).Type.GetDefinition()))
return false;
}
}
n = n.NextSibling;
}
return true;

Loading…
Cancel
Save