Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
[Formatting] Checked token for null, before using the parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Apr 18, 2012
1 parent 6d1e90b commit 1a1487f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs
Expand Up @@ -874,8 +874,10 @@ void FormatParameters(AstNode node)
} }
ForceSpacesBeforeRemoveNewLines(rParToken, spaceWithinMethodCallParentheses); ForceSpacesBeforeRemoveNewLines(rParToken, spaceWithinMethodCallParentheses);
} }
foreach (CSharpTokenNode comma in rParToken.Parent.Children.Where(n => n.Role == Roles.Comma)) { if (!rParToken.IsNull) {
ForceSpacesBefore(comma, spaceBeforeMethodCallParameterComma); foreach (CSharpTokenNode comma in rParToken.Parent.Children.Where(n => n.Role == Roles.Comma)) {
ForceSpacesBefore(comma, spaceBeforeMethodCallParameterComma);
}
} }
} }


Expand Down Expand Up @@ -1777,8 +1779,10 @@ void FormatArguments(AstNode node)
} }
ForceSpacesBeforeRemoveNewLines(rParToken, spaceWithinMethodCallParentheses); ForceSpacesBeforeRemoveNewLines(rParToken, spaceWithinMethodCallParentheses);
} }
foreach (CSharpTokenNode comma in rParToken.Parent.Children.Where(n => n.Role == Roles.Comma)) { if (!rParToken.IsNull) {
ForceSpacesBefore(comma, spaceBeforeMethodCallParameterComma); foreach (CSharpTokenNode comma in rParToken.Parent.Children.Where(n => n.Role == Roles.Comma)) {
ForceSpacesBefore(comma, spaceBeforeMethodCallParameterComma);
}
} }
} }


Expand Down

0 comments on commit 1a1487f

Please sign in to comment.