Skip to content

Commit 12b49bc

Browse files
committed
Fix oversight in blockScope hanlder's whitespace possibly returning null
1 parent d52ddac commit 12b49bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

RetailCoder.VBE/Navigation/CodeMetrics/CodeMetricsAnalyst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public override void EnterBlockStmt([NotNull] VBAParser.BlockStmtContext context
172172
{
173173
var ws = context.whiteSpace();
174174
// FIXME only take the last contiguous non-linebreak into account
175-
results.Add(new CodeMetricsResult(0, 0, ws.ChildCount / _indenterSettings.IndentSpaces));
175+
results.Add(new CodeMetricsResult(0, 0, (ws?.ChildCount ?? 0) / _indenterSettings.IndentSpaces));
176176
}
177177

178178
private void ExitMeasurableMember()

0 commit comments

Comments
 (0)