Browse Source

Fix ArgumentNullException in RedundantCatchClauseIssue.GatherVisitor.IsRedundant()

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

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

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

Loading…
Cancel
Save